在Python中,令values=[0,1,2];values[1]=values,为何结果是[0,[...],2]?

WBOY
發布: 2016-06-06 16:03:54
原創
2061 人瀏覽過

<span class="o">>>></span> <span class="n">values</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
<span class="o">>>></span> <span class="n">values</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">values</span>
<span class="o">>>></span> <span class="n">values</span>
<span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="o">...</span><span class="p">],</span> <span class="mi">2</span><span class="p">]</span>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板