n = input("请输入一个整数:") # 括号内的内容会打印在屏幕上
>>> n = input('please keyin:')
please keyin:
# input()输入默认为字符串类型,如果输入为数字需要进行转换
n = int(input()) #整型
n = float(input()) #浮点型
n = eval(input()) #根据实际情况决定n的类型
#有多个数据时可以用map函数接收(明确变量个数时)
>>> a, b, c = map(int, input().split()) # split()默认以空格分离
1 2 3
>>> a, b, c
(1, 2, 3)
>>> a, b, c = map(float, input().split())
1 1.1 1.2
>>> a, b, c
(1.0, 1.1, 1.2)
>>> a, b, c = map(eval, input().split(','))
1,2.2,3
>>> a,b,c
(1, 2.2, 3)
>>> a, b, c = map(str, input().split())
sdf sdf se
>>> a,b,c
('sdf', 'sdf', 'se')
# 当不清楚变量个数时,用list
>>> a = list(map(eval, input().split(', ')))
3, 4, 4.4, 6.6
>>> a
[3, 4, 4.4, 6.6]