元祖在命令行里的操作


C:Users太阳之泪>python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> test = (1,2,3)
>>> print(test)
(1, 2, 3)
>>> test = (1)
>>> print(test)
1
>>> type(test)
<class 'int'>
>>> test = (1.)
>>> type(test)
<class 'float'>
>>> test = (1,)
>>> type(test)
<class 'tuple'>

原文地址:https://www.cnblogs.com/antique/p/10232367.html