Python3中input的用法

input()是一种获取用户输入的方法,从标准输入中读入一个字符串,并自动忽略换行符\n。

换行符\n

>>> print('a\nb')
a
b

>>> user_money = input("please input your money:")
please input your money:1 # 1 是我自己输入的
>>> print(user_money)
1

 

posted @ 2018-05-29 23:09  无证骑士  阅读(1063)  评论(0)    收藏  举报