Python 练习1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python 练习1相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env python
#codingutf-8
count = 0
while count < 3:
   username = raw_input("USERNAME:")
   password = raw_input("PASSWORD:")
   if username == "user" and password == "123":
       print "welcome!!!"
       
break
   elif
username != "user" and password != "123":
       print "username or password wrong!!!"
   
elif username == "user" and password != "123":
       print "password is wrong!!!"
   
elif username != "user" and password == "123":
       print "username or password is wrong!!!"
   
count +=1
   
if count == 3:
       print "go away ang don‘t back!!!"

技术分享

以上是关于Python 练习1的主要内容,如果未能解决你的问题,请参考以下文章

Python编码练习题

Python语言基础与应用 (P16)上机练习:基本数据类型

Python语言基础与应用 (P23)上机练习:容器类型操作(未完待续)

1python??????

1Python初识

1Python环境安装部署