* **Methods whose names start and end with two underscores are called special methods. They are executed when object is passed to a built-in function or used as an operand, for example, `'print(a)'` calls `'a.__str__()'` and `'a + b'` calls `'a.__add__(b)'`.**
* **Methods decorated with `'@staticmethod'` receive neither 'self' nor 'cls' argument.**
* **Return value of str() special method should be readable and of repr() unambiguous. If only repr() is defined, it will also be used for str().**
#### Expressions that call the str() method:
@ -3408,16 +3409,16 @@ import plotly.express as px, pandas as pd
@ -831,6 +831,7 @@ player = Player(point, direction) <span class="hljs-comment">#
</code></pre>
<ul>
<li><strong>Methods whose names start and end with two underscores are called special methods. They are executed when object is passed to a built-in function or used as an operand, for example, <codeclass="python hljs"><spanclass="hljs-string">'print(a)'</span></code> calls <codeclass="python hljs"><spanclass="hljs-string">'a.__str__()'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'a + b'</span></code> calls <codeclass="python hljs"><spanclass="hljs-string">'a.__add__(b)'</span></code>.</strong></li>
<li><strong>Methods decorated with <codeclass="python hljs"><spanclass="hljs-string">'@staticmethod'</span></code> receive neither 'self' nor 'cls' argument.</strong></li>
<li><strong>Return value of str() special method should be readable and of repr() unambiguous. If only repr() is defined, it will also be used for str().</strong></li>
</ul>
<div><h4id="expressionsthatcallthestrmethod">Expressions that call the str() method:</h4><pre><codeclass="python language-python hljs">print(<obj>)
<Fig>.update_layout(paper_bgcolor=<spanclass="hljs-string">'rgb(0, 0, 0)'</span>)<spanclass="hljs-comment"># Also `margin=dict(t=0, r=0, b=0, l=0)`.</span>
<Fig>.write_html/json/image(<spanclass="hljs-string">'<path>'</span>) <spanclass="hljs-comment"># `<Fig>.show()` displays the plot.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><Fig> = px.area/bar/box(<DF>, x=col_key, y=col_key)<spanclass="hljs-comment"># Also `color=col_key`.</span>
<Fig> = px.scatter(<DF>, x=col_key, y=col_key)<spanclass="hljs-comment"># Also `color/size/symbol=col_key`.</span>
<Fig> = px.scatter_3d(<DF>, x=col_key, y=col_key, …) <spanclass="hljs-comment"># `z=col_key`. Also color/size/symbol.</span>
<Fig> = px.histogram(<DF>, x=col_key) <spanclass="hljs-comment"># Also `nbins=<int>`.</span>
<pre><codeclass="python language-python hljs"><Fig> = px.area/bar/box(<DF>, x=col_key, y=col_keys) <spanclass="hljs-comment"># Also `color=col_key`. All are optional.</span>
<Fig> = px.scatter(<DF>, x=col_key, y=col_keys) <spanclass="hljs-comment"># Also `color/size/symbol=col_key`. Same.</span>
<Fig> = px.histogram(<DF>, x=col_keys, y=col_key)<spanclass="hljs-comment"># Also `nbins=<int>`. All are optional.</span>
</code></pre>
<div><h4id="displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent">Displays a line chart of total coronavirus deaths per million grouped by continent:</h4><p></p><divid="2a950764-39fc-416d-97fe-0a6226a3095f"class="plotly-graph-div"style="height:312px; width:914px;"></div><pre><codeclass="python language-python hljs">covid = pd.read_csv(<spanclass="hljs-string">'https://raw.githubusercontent.com/owid/covid-19-data/8dde8ca49b'</span>