python中同時給多個 變量賦值、同時清空多個變量


 

>>> a = 5
>>> print(a) 5
>>> b = 7
>>> print(b) 7
>>> c = 9
>>> print(c) 9
>>> a,b,c = 4,0,3 ## 同時給多個變量賦值
>>> print(a) 4
>>> print(b) 0
>>> print(c) 3
>>> del a,b,c ## 同時刪除多個變量 >>> print(a) Traceback (most recent call last): File "<pyshell#191>", line 1, in <module> print(a) NameError: name 'a' is not defined >>> print(c) Traceback (most recent call last): File "<pyshell#192>", line 1, in <module> print(c) NameError: name 'c' is not defined

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM