fork download
  1. def check_phrase(requested_phrase, attempts):
  2. for i in range(attempts):
  3. phrase =input("Please enter the phrase: ")
  4. if phrase == requested_phrase:
  5. print("Good job")
  6. return True;
  7. else:
  8. print("Please try again")
  9. print("Attempts exceeded")
  10. return False
  11. def main():
  12. phrase = "Hello world"
  13. attempts = 3
  14. check_phrase(phrase, attempts)
  15. if __name__ == "_main_":
  16. main()
Success #stdin #stdout 0.03s 9544KB
stdin
Standard input is empty
stdout
Standard output is empty