What's going on with my if-else statement? (Python 3.3)

前端 未结 4 587
终归单人心
终归单人心 2020-12-22 05:35

I\'m writing conditional statements for a billing program project. It\'s a bit advanced for a beginner I know but I welcome the challenge. Anyways, I plan on starting the pr

4条回答
  •  别那么骄傲
    2020-12-22 06:29

    print ("Hello, welcome to Facebook, please enter your username and password to access.")
    
    username = input ("Enter username:")
    
    if username == "cking":
      print ("Valid username.")
    else:
      print ("Invalid username. Please try again.") 
    
      username = input ("Enter username:")
    
    if username == "cking":
      print ("Valid username.")
    else:
      print ("Invalid username. Please try again.") 
    
    
    password = input ("Enter password:")
    
    if password ==  "tupac1":
      print ("Valid password. User has been verified.")
    else:
      print ("Invalid password. Access denied.")
    
      password = input ("Enter password:")
    
    if password ==  "tupac1":
      print ("Valid password. User has been verified.")
    else:
      print ("Invalid password. Access denied.")
    

提交回复
热议问题