似晨 发表于 2020-7-2 22:51:03

password='ab321' a = 0 while a != 1 : userpwd = input('请输入密码 :')if userpwd == password :print('密码正确,欢迎你!') a = 1      #想想这句代码会产生什么作用 ? else : print('密码错误,不能进入 !')

大朋友 发表于 2020-7-2 22:51:15


password='ab321’
a=0

while a!= 1:
    userpwd=input(’请输入密码:’)
    if userpwd==password:
       print('密码正确,欢迎你!')
       a=1         
    else:
       print('密码错误,不能进入!')

202201代珈宁 发表于 2020-7-2 23:05:21

password = 'ab321'
a = 0
while a != 1:
    userpwd = input('请输入密码    ')
    if userpwd == password:
      print('密码正确,欢迎你')
      a = 1
    else:
            print('密码错误,不能输入')

林靖宜 发表于 2020-7-2 23:31:52

wct 发表于 2020-7-2 23:39:47

password = '立人创客'

while True:
    user_password = input('输入你的密码:   ')
    if user_password == password:
      print('密码正确,可以进入')
      break
    else:
      print('密码错误,请再次尝试')

2022.5邓锦鸿 发表于 2020-7-2 23:54:47

Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> password = 'aa'
>>> userpwd = " "
>>> while password != userpwd :
userpwd == input('请输入密码 :')
56


请输入密码 :34
False
56
请输入密码 :56
False
56
请输入密码 :

2022.5邓锦鸿 发表于 2020-7-2 23:58:38

Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> password = 'ab'
>>> userpwd = " "
>>> while password != userpwd :
userpwd == input('请输入密码 :')
print('恭喜您,密码正确!')

黎紫木 发表于 2020-7-3 07:06:42

http://bbs.jnschool.com/forum.php?mod=attachment&aid=MTg1NXxjNzg4NjZmNXwxNTkzNzMwOTI1fDU1NHw1MTM%3D&nothumb=yes

黎紫木 发表于 2020-7-3 07:10:22

期末动手检测

晏靖翀 发表于 2020-7-3 07:49:50


页: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14
查看完整版本: 2019-2020下期末动手检测