jeudi 17 décembre 2020

Please help a beginner in Python

I've done some (very, very) basic Python coding before but stopped for a while and now I'm trying to pick it back up again.

I'm having an issue with something I just wrote and I was wondering if someone could help please. I forgot how to use the if elif else function.

(also please ignore the weird purpose of the code I like to confuse my friends)

print('Welcome to this horrible choose your own adventure story')
print(' ')

print("To select which of the options you'd like to pick, type the corresponding number")
print(' ')

print("You're walking in the woods")
print("There's no one around and your phone is dead")
print("Out of the corner of your eye, you spot him")
print("Shia LaBoeuf")

pingu = int(input("Do you turn left (1) or right (2)? ")

if pingu == 1:
    print('You turned left. ')
if name == '2':
    print('You turned right. ')

Aucun commentaire:

Enregistrer un commentaire