日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

关于Python3.6下登陆接口的尝试

發布時間:2023/11/29 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 关于Python3.6下登陆接口的尝试 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

編者按:
README:此代碼為用戶登陸界面,添加了尋求幫助選項。
1.學習了基本數據類型,string, int,以及while循環,continue, break, if, elif, else條件語句,“x".format(x)變量替代
2.上網搜的dictionary用法,由于用的是python3.6,老教程不太管用,嘗試了2天方才悟出正確的增加鍵值用法,希望技術大牛留言給予更多啟發!

1 dict_profile = {"Alex":"alex1234", "Bob":"bob123", "Cathy":"cathy1234", 2 "David":"david12345", "Eva":"eva123"} 3 #Save the rightful username and password in the dictionary 4 black_list = { } #Create a list for not exist username 5 email = "send an email to our help desk for further solutions" 6 chance = 6 #After 3 valid trys the system will be locked 7 username = input("username:") 8 password = input("password:") 9 #password = getpass.getpass("password:") 10 while chance > 0: 11 if username not in dict_profile.keys(): #Search for username in the profile 12 black_list["{}".format(username)]="{}".format(password) 13 username = input("The username does not exist, please try again:") 14 chance = chance - 1 15 if username in black_list.keys(): #Run a security check 16 username = input("The username does not exist and has been locked, please try other combinations:") 17 chance = chance - 2 # Deduct 2 chances to punish whoever abuses the system 18 elif password != dict_profile.get(username,""): #Find the value of password to match with the username 19 print("The password does not match the username, do you have problem with memorizing things?") 20 customized_option = input("Y/N") 21 if customized_option != "N": 22 print("Please ask your partner or {}.".format(email)) 23 break 24 else: 25 password = input("Please enter your password with caution:") 26 chance = chance - 1 27 else: 28 print("Welcome my lord {_name}! Please wait while login...".format(_name = username)) 29 break 30 if chance <= 0: 31 print("The system is locked since you have too many incorrect entries!Please {}.".format(email)) 登陸接口

?

轉載于:https://www.cnblogs.com/SuperGokuBeta/p/8068724.html

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的关于Python3.6下登陆接口的尝试的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。