0

i want to Write a piece of code that repeatedly asks for input until the user enters your first name correctly. Once the user enters specific name, print a positive message congratulating the user. if not it will ask again until the user will put the name?

martineau
  • 119,623
  • 25
  • 170
  • 301
UX373
  • 3
  • 1

1 Answers1

0
correct_name = 'John'
print('Enter your first name:')
name = input()
while name != correct_name:
    print('Incorrect. Please enter your first name:')
    name = input()
print('Correct')
Nathaniel
  • 3,230
  • 11
  • 18