[Tutor] Fwd: IndentationError: unexpected indent

Alan Gauld alan.gauld at yahoo.co.uk
Tue Nov 8 11:09:57 EST 2016


On 08/11/16 14:47, Palanikumar Gopalakrishnan wrote:
> Hi Guys,
>              I tried this code from internet, Its returns following please
> guide me to solve this error

> 
> * passwordFile = open('File.txt') secretPassword =
> passwordFile.read() print('Enter your password.') typedPassword = input()
> if typedPassword == secretPassword:    print('Access granted')    if
> typedPassword == '12345':       print('That password is one that an idiot
> puts on their luggage.')  else:    print('Access denied')*

Since the code has no indentation at all I assume you
have posted in HTML or somesuch. You need to post using
plain text so we can see the indentation.

Also do not summarize the error but post the full error text.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list