[Tutor] Python help

Alex Kleider akleider at sonic.net
Sun Oct 16 22:52:52 EDT 2016


On 2016-10-15 15:48, Nicholas Hopkins wrote:
> Hello
> Please tell me what is wrong with my code and how I can put an if else
> statement inside of another if else statement
> This is my code:
> path = input('Which path number will you take?')
>     if path == '1':
>          print('You took the first path')
>     elif path == '2':
>          print('You choose to take the second path')
>          print('You see a rock')
>           rock == input('Do you want to pick up the rock')
>           if rock == 'yes':
>               print('you picked up the rock')
>           else:
>               print('You left the rock')
>     elif path == '3':
>          print('You choose to take the third path')
>     else:
>          print('You must choose a number between 1 and 3')
> 
> 
> it comes up with this error
> [cid:image001.png at 01D22792.63CCF290]

Can't see your error (text only list) but it's probably due to 
indentation problems.
Why do you have only the first line not indented?
Also check indentation of lines 7, 8 and 10.


> Thanks
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows 10
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list