<section id="nice" data-tool="mdnice 编辑器" data-website="
https://www.mdnice.com" style="font-size: 16px; color: black; padding: 0 10px; line-height: 1.6; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><pre class="custom" data-tool="mdnice 编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(
https://files.mdnice.com/user/3441/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;"><span class="hljs-function" style="line-height: 26px;"><span class="hljs-keyword" style="color: #c678dd; line-height: 26px;">def</span> <span class="hljs-title" style="color: #61aeee; line-height: 26px;">foo</span><span class="hljs-params" style="line-height: 26px;">()</span>:</span><br> c = <span class="hljs-string" style="color: #98c379; line-height: 26px;">"hello"</span><br> x = <span class="hljs-number" style="color: #d19a66; line-height: 26px;">0</span><br> <span class="hljs-function" style="line-height: 26px;"><span class="hljs-keyword" style="color: #c678dd; line-height: 26px;">def</span> <span class="hljs-title" style="color: #61aeee; line-height: 26px;">bar</span><span class="hljs-params" style="line-height: 26px;">()</span>:</span><br> b = <span class="hljs-literal" style="color: #56b6c2; line-height: 26px;">True</span><br> print(a)<br> print(b)<br> print(c)<br> x = a<br> print(x) <span class="hljs-comment" style="color: #5c6370; font-style: italic; line-height: 26px;"># 新增这条</span><br> bar()<br> print(x)<br><br><br><span class="hljs-keyword" style="color: #c678dd; line-height: 26px;">if</span> __name__ == <span class="hljs-string" style="color: #98c379; line-height: 26px;">"__main__"</span>:<br> a = <span class="hljs-number" style="color: #d19a66; line-height: 26px;">100</span><br> foo()<br></code></pre>
</section>