Encountered a lot of code, unable to find the cause of the problem:
All the characters in the Python script can be displayed to see if there are any special characters.
Text Editor notepad++, display all character views--display symbols-- display spaces and tabs
Found the problem (alignment with a dot dot space, is the same as the previous lines of the alignment of the arrow indicated by the TAB key, is not matched, that is, the alignment of the code, mixed with the TAB key and Space:)
Preferences: languages, replace with spaces (Tab key):
# import Getpass getpass.getpass ("Password:")
' TypeError: ' >= ' not supported between instances of ' str ' and ' int ' character type inconsistent error int conversion data type
Indentationerror:expected an indented block error is code not aligned
Reference https://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/
‘‘‘
Username = "Wangyachao"
Password = "123"
UserName1 =input ("username")
Password1 = input ("password")
If Username==username1 and Password==password1:
Print ("Welcome User{name} Login ...". Format (name=username))
Else
Print ("Invalid username or password")
Old_of_boy = 56
#guess_age =int (Input ("Pesse input Age:") is the correct representation
Count = 0
While count<3:
Count = count + 1 # equivalent to count + = 1
guess_age = Int (input ("please"))
If Guess_age==old_of_boy:
Print ("Yes.") You get It ")
Break
Elif Guess_age>=old_of_boy:
Print ("Think bigger!")
Else
Print ("Think smaller!")
‘‘‘
For I in Range (0,10): #开始 End step Contimue end this loop break end Loop
If i<5:
Print ("Loop", i)
Else
Continue
Print ("hehe -----")
‘‘‘
Python Foundation--if and while