程序的交互性
>基础语法
-
input
输入一个值(字符串)
-
字符串与其他数据类型相互转换
#其他数据类型转换为字符串
#author:xuer
>>> str(2)
'2'
>>> str((1,2,3))
'(1, 2, 3)'
>>> str({"1":2,"3":4})
"{'1': 2, '3': 4}"
>>> str([1,2,3])
'[1, 2, 3]'
>>> "".join(['1','2','3'])
'123'
#字符串转换为其他数据类型
#author:xuer
>>> int("123")
123
>>> int("123")+11
134
>>> float("123")
123.0
>>> tuple("123