if while 條件語句 第六題 改

1.用戶登陸(三次機會重試)input

n = 1登錄

while n < 4循環

  user = input(">>>")密碼

  pwd = input(">>>")while

  if user == "alex" and pwd == ("123")錯誤

  print('歡迎登陸‘’)

  break  終止全部循環

else

  print(‘用戶密碼錯誤’)

  n = n + 1

相關文章
相關標籤/搜索