+ 1
Unexpected indent?
Hi, I'm currently making a Hangman game in Python and I've got an unexpected indent error, but I'm not sure why? (The error is where I've put hashtags (there aren't hashtags in the actual script)) def get_num_attempts(): ##################################### while True: try: num_attempts = int(input("How many incorrect attempts do you want (1 - 25) ? ")) if 1<= num_attempts <= 25: print("Ok!", (num_attempts), "it is!") break else: print("Invalid input. Please try again.") continue except ValueError: print("Invalid input. Please try again.") continue
3 odpowiedzi
+ 3
Well, it works fine on Sololearn in the playground...
Make sure you don't mix tabs and spaces, often that's the reason
0
Can you give the link of your code, please? It will be easier for us to help you.