1 2 3 4 |
<span class="cm-variable">alphabet</span> = [<span class="cm-string">"a"</span>,<span class="cm-string">"d"</span>,<span class="cm-string">"e"</span>,<span class="cm-string">"c"</span>,<span class="cm-string">"b"</span>] <span class="cm-builtin">sorted</span>(<span class="cm-variable">alphabet</span>) <span class="cm-builtin">print</span>(<span class="cm-variable">alphabet</span>) |
adecbの順番で出力
1 2 3 4 5 |
<span class="cm-variable">alphabet</span> = [<span class="cm-string">"a"</span>,<span class="cm-string">"d"</span>,<span class="cm-string">"e"</span>,<span class="cm-string">"c"</span>,<span class="cm-string">"b"</span>] <span class="cm-variable">alphabet</span>.<span class="cm-property">sort</span>() <span class="cm-builtin">print</span>(<span class="cm-variable">alphabet</span></code><code class="cm-s-ipython language-python">)</code><code class="cm-s-ipython language-python"> abcdeの順番で出力 |