def SignupDetails():
Name= input("enter name: ")
Age= int(input("enter your age: "))
yeargroup= input("Enter your year group: ")
username= Name[0:3]+str(Age)
print("username: ",username)
Password= input("please enter a password: ")
Password2= input("re-enter your password to confirm: ")
if Password != Password2:
print("the passwords do not match")
我想創建一個while循環,這將使用戶在密碼和密碼2匹配前一直輸入密碼。任何幫助將不勝感激如何爲我的密碼創建一個while循環
閱讀[凱文的回答](https://stackoverflow.com/a/23294659/918959),尤其是在標題**實施您自己的驗證規則**你呃讀別人也不會傷害。 –