标签:一行代码 range class nbsp input put 特殊用法 style bsp
values=input(">>>") l=values.split(",") t=tuple(l) print(f"List of values : {l}") print(f"Tuple of values : {t}") x = {‘name‘:"xiong","age":26} print(f"{x}") ‘‘‘ >>>12,56,48,98,36,22 List of values : [‘12‘, ‘56‘, ‘48‘, ‘98‘, ‘36‘, ‘22‘] Tuple of values : (‘12‘, ‘56‘, ‘48‘, ‘98‘, ‘36‘, ‘22‘) {‘name‘: ‘xiong‘, ‘age‘: 26} ‘‘‘
n=int(input(">>>")) d={x:x*x for x in range(1,n+1)} print(d) """ >>>8 {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64} """
标签:一行代码 range class nbsp input put 特殊用法 style bsp
原文地址:https://www.cnblogs.com/XJT2018/p/11024469.html