写出关于tu1、tu2的输出结果
1 tu1 = (1) 2 tu2 = (1,) 3 print(tu1,type(tu1)) 4 print(tu2,type(tu2)) 5 print(len(tu1)) 6 print(len(tu2)) 7 ''' 8 结果为: 9 1 <class 'int'> 10 (1,) <class 'tuple'> 11 报错 12 1 13 '''
1 tu1 = (1) 2 tu2 = (1,) 3 print(tu1,type(tu1)) 4 print(tu2,type(tu2)) 5 print(len(tu1)) 6 print(len(tu2)) 7 ''' 8 结果为: 9 1 <class 'int'> 10 (1,) <class 'tuple'> 11 报错 12 1 13 '''
转载于:https://www.cnblogs.com/ershoupaoche/p/9515968.html