input()

在python3中,无论输入的是数字还是字符,都将被作为字符串读取。如果想要接受数值,需要把接收到的字符串进行类型转换

例:

1 inp = input('请输入数字:')
2 print(type(inp))
3 new_inp = int(inp)
原文地址:https://www.cnblogs.com/xhdy/p/14264344.html