![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
天寒地冻路遥马亡
这个作者很懒,什么都没留下…
展开
-
python在input时无法使用退格键backspace
先写一个带input的脚本,代码如下#!/usr/bin/env pythonheight = input('PLS input your height(m): ')weight = input('PLS input your weight(kg): ')BMI = weight / (height * height)print BMI然后在系统里运行这个脚本,在输入input的...原创 2018-07-20 10:21:52 · 5301 阅读 · 1 评论 -
python使用input接受控制台输入字符串的问题
python在使用input接受字符串的时候,在输入时是需要加上''单引号的,如果不加上,会引发一个nameerror,其实在接受字符串的时候,最简单的是使用raw_input,这样就不会出发这个问题了。...原创 2018-07-20 15:27:49 · 10530 阅读 · 0 评论