1. ? ? ? __add__
1 a = (1,2,3,4,5,6,7,8,9,) 2 b = (10,11,22,33,44,55,66,), 3 c = (110,112,113,114,), 4 result = a.__add__(b) 5 print(result) #(1, 2, 3, 4, 5, 6, 7, 8, 9, (10, 11, 22, 33, 44, 55, 66)) add(b)里面只能加一个参数,否则会报错 6 print(a+b+c) #(1, 2, 3, 4, 5, 6, 7, 8, 9, (10, 11, 22, 33, 44, 55, 66), (110, 112, 113, 114))
1 a = (1,2,3,4,5,6,7,8,9,) 2 b = (10,11,22,33,44,55,66,) 3 c = (110,112,113,114,) 4 result = a.__add__(b) 5 print(result) #(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 22, 33, 44, 55, 66) 有没有逗号的区别哈哈 6 print(a+b+c) #(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 22, 33, 44, 55, 66, 110, 112, 113, 114)
?
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com