Love丶FFC's Blog
本题要求你帮助某网站的用户注册模块写一个密码合法性检查的小功能。该网站要求用户设置的密码必须由不少于6个字符组成,并且只能有英文字母、数字和小数点 .
,还必须既有字母也有数字。
输入第一行给出一个正整数 N(≤ 100),随后 N 行,每行给出一个用户设置的密码,为不超过 80 个字符的非空字符串,以回车结束。
对每个用户的密码,在一行中输出系统反馈信息,分以下5种:
如果密码合法,输出Your password is wan mei.
;
如果密码太短,不论合法与否,都输出Your password is tai duan le.
;
如果密码长度合法,但存在不合法字符,则输出Your password is tai luan le.
;
如果密码长度合法,但只有字母没有数字,则输出Your password needs shu zi.
;
如果密码长度合法,但只有数字没有字母,则输出Your password needs zi mu.
。
5
123s
zheshi.wodepw
1234.5678
WanMei23333
pass*word.6
Your password is tai duan le.
Your password needs shu zi.
Your password needs zi mu.
Your password is wan mei.
Your password is tai luan le.
1.对每种情况逐一判断
2.注意判断全为数字或全为字母时需要同时判断小数点
NOP = int(input()) List = ['.', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] # 合法的字符 for i in range(NOP): Judge = True # 标记各种情况,默认为符合 Password = input() if len(Password) < 6: # 密码长度不足 print("Your password is tai duan le.") else: for j in range(len(Password)): if Password[j] not in List: # 存在不合法的字符 Judge = False print("Your password is tai luan le.") break if Judge: for j in range(len(Password)): if not Password[j].isalpha() and Password[j] != '.': # 该字符不是字母或小数点 Judge = False break if Judge: # 该密码全为字母+小数点 print("Your password needs shu zi.") else: Judge = True for j in range(len(Password)): if not Password[j].isnumeric() and Password[j] != '.': # 该字符不是数字或小数点 Judge = False break if Judge: # 该密码全为数字+小数点 print("Your password needs zi mu.") else: print("Your password is wan mei.")
cheap jordans
I just wanted to thank you for the fast service. quite possibly they look great. I received them a day earlier than expected. such as the I will definitely continue to buy from this site. in either case I will recommend this site to my friends. Thanks!
cheap jordans https://www.cheaprealjordan.com/
cheap louis vuitton handbags
I just wanted to thank you for the fast service. also they look great. I received them a day earlier than expected. just like I will definitely continue to buy from this site. regardless I will recommend this site to my friends. Thanks!
cheap louis vuitton handbags https://www.louisvuittonsoutletstore.com/
cheap jordan shoes
I just wanted to thank you for the fast service. also known as they look great. I received them a day earlier than expected. much I will definitely continue to buy from this site. no matter what I will recommend this site to my friends. Thanks!
cheap jordan shoes https://www.realcheapretrojordanshoes.com/
cheap jordans online
I just wanted to thank you for the fast service. and they look great. I received them a day earlier than expected. particularly I will definitely continue to buy from this site. you decide I will recommend this site to my friends. Thanks!
cheap jordans online https://www.realjordansretro.com/
cheap jordan shoes
Read reviews and was a little hesitant since I had already inputted my order. perhaps but thank god, I had no issues. the same as received item in a timely matter, they are in new condition. situation so happy I made the purchase. Will be definitely be purchasing again.
cheap jordan shoes https://www.cheapretrojordan.com/
FoorryNox
These findings are in agreement with the data obtained with the constitutive knockout model and suggest that, under steady state conditions of normal dietary P i, NaPi IIc is not an essential Na P i cotransporter in murine kidneys where to buy cialis cheap Enteropathy type intestinal T cell lymphoma
cheap jordans for sale
Read reviews and was a little hesitant since I had already inputted my order. or even a but thank god, I had no issues. like the received item in a timely matter, they are in new condition. you decide so happy I made the purchase. Will be definitely be purchasing again.
cheap jordans for sale https://www.authenticcheapjordans.com/
cheap louis vuitton
Read reviews and was a little hesitant since I had already inputted my order. and but thank god, I had no issues. similar to received item in a timely matter, they are in new condition. in either case so happy I made the purchase. Will be definitely be purchasing again.
cheap louis vuitton https://www.louisvuittonsoutletonline.com/
authentic cheap jordans
Read reviews and was a little hesitant since I had already inputted my order. or perhaps even but thank god, I had no issues. for example the received item in a timely matter, they are in new condition. you decide so happy I made the purchase. Will be definitely be purchasing again.
authentic cheap jordans https://www.realjordansshoes.com/
Preliaf
cheapest priligy uk Measurable the first visit our milf chat condition