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

WBOY
Release: 2016-06-06 16:03:54
Original
2056 people have browsed it

<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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!