+ 1

Python Indentation Question

password = input() repeat = input() def validate(text1, text2): if text1 == text2: print("Correct") else: print("Wrong") validate(password, repeat) There seems to be some indentation with the 5th line, but I don't get it?

26th Jun 2022, 8:51 PM
Ayesha Tajalli
3 ответов
+ 2
There are some invalid non-printable characters in the indent spaces. This happens sometimes when you copy and paste from an outside source. Delete all the indent spaces and retype them.
26th Jun 2022, 8:57 PM
Brian
Brian - avatar
+ 2
Indentation in python needs to be consistent. If you first use 2 spaces to indent your line, you need to keep using 2 spaces. Also note that using tab to indent is not the same as using 4 spaces, although they look the same. Therefore, as Brian mentioned, you should retype the spaces.
26th Jun 2022, 9:03 PM
EricMcDerrick
EricMcDerrick - avatar
+ 2
I shall try. Thank you :)
26th Jun 2022, 9:09 PM
Ayesha Tajalli