【python】input
来源:互联网 发布:淘宝旺旺官方买家 编辑:程序博客网 时间:2024/05/01 02:51
今天使用python3.2来编辑程序的时候,突然发现一个错误name 'raw_input' is not defined,原因是从版本3.0 开始去掉了raw_input 函数,改用input。所以两个函数合并在了一起,所以今天只讲input函数就可以了。
#!/usr/bin/python
# -*- coding: UTF-8 -*-
var = 1
while var == 1 : # 该条件永远为true,循环将无限执行下去
num = input("Enter Password:")
if (num != "password"):
print ("You entered wrong password!")
else:
print ("Login success! Welcome!")
break
print ("Good bye!")
结果
E:\Pyfile>python test.py
Enter Password:wangsd
You entered wrong password!
Enter Password:password
Login success! Welcome!
Good bye!
0 0
- 【python】input
- Python input()
- python input()
- Python if and input
- Python input() pk raw_input()
- 【python】raw_input() 和input()
- Python raw_input() 和input()
- python输入输出---input,raw_input
- Python raw_input() vs input()
- Python input and output
- input in python
- python input()与raw_input()
- day15 Python input
- python input输入函数
- 【Python】input的使用
- [Python] input() vs raw_input()
- raw_input() 与 input() Python
- Python input和raw_input
- 前端CSS规范
- 详解spl_autoload_register()函数
- UT-Austin大学在Image search and large-scale retrieval方面的一系列papers
- Winbond Trusted Platform Module 1.2 驱动安装解决办法详解
- 修改自增属性为非自增
- 【python】input
- 设计模式(三)----- 建造者模式(Builder)----(JAVA版)
- Android启动相机拍照并返回图片
- clion 32位xp安装 64位软件
- javascript中有趣的面向对象的思想
- CocoaPods 升级遇到问题
- 信息战(一)——加密程序
- win下同时安装了python2.x和python3.x
- 创建替代(Instead_of)触发器