标签:list round print 查看 pytho tuple ccf back type
list转为tuple:
temp_list = [1,2,3,4,5]
将temp_list进行强制转换:tuple(temp_list)
查看是否转换成功:print type(temp_list)
tuple 转为list:
temp_tuple = (1,2,3)
方法类似,也是进行强制转换即可:list(temp_tuple)
查看是否转换成功:print type(temp_tuple)
标签:list round print 查看 pytho tuple ccf back type
原文地址:https://www.cnblogs.com/lmh001/p/9790219.html