習題

1.分別取出0到10中的偶數和奇數

wKiom1ld9VeCWAn7AAAyTCiU3FY709.png-wh_50

 2.判斷一個數是否是質數

wKiom1ld9VigTF6qAAERl_ls4us060.png-wh_50

3.題目

wKioL1lceJSSa5xJAAEoeyET_Jw649.png

*程序

user =["mengke","songzhao"]
passwd =["123","1234"]

print '''
         welcome to system
       (C)reate
       (L)ogin
'''
x =len(user)
while True:
    data =raw_input("please inputyour choise: ")
    ss = data.upper()
    if ss == "C":
        for j in range(0,x):
            name =raw_input("name")
            if name == user[j]:
                print "userexsit"
                break
            else:
                password =raw_input("passwd: ")
                user.append(name)
               passwd.append(password)
                print "cteate userok"
                break
    elif ss == "L":
        for i in range(1,4):
            name =raw_input("username:")
            password=raw_input("passwd:")
            for w in range(0,x):
               if name == user[w] andpassword ==passwd[w]:
                   print"welcome"
                   exit(0)
               else:
                   print "請輸入正確的用戶名和密碼"
                   break
               print "你已經登陸過三次,請10m以後再登陸"
               break
            else:
                print "請輸入正確的命令"

 


wKioL1ld9VjRE3wqAACStzDiR-0593.png-wh_50

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章