Python3购物车的一些随笔——input()

购物车要求:启动程序后,让用户输入金额
>>> user_money = input("please input your money:")
please input your money:100000000
>>> user_money
'100000000'   # 数字是带引号的,但是它可以被识别为数字
>>> user_money.isdigit()
True
>>> print(int(user_money))
100000000

 

posted @ 2018-05-31 23:26  无证骑士  阅读(151)  评论(0编辑  收藏  举报