元祖在命令行里的操作


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'>

posted @ 2019-01-07 11:41  Mission。  阅读(124)  评论(0编辑  收藏  举报