Functions in python
mhs_mhs123 (4)

Hey everyone, I'm a new python dev and i'm trying to familiarize myself with functions. for my first functions project, I tried making a miles to km converter, but I'm running into an error. can someone tell me what I did wrong and how to fix it. Thanks.

https://repl.it/@mhs_mhs123/milestokmconverter

You are viewing a single comment. View All
HenryShearer (2)

@mhs_mhs123 Ok so in the waterfall portion, change the "and" to an "or", because you can only change one of them each game, and when it checks for an undefined variable it breaks,

Make this:

if pick_waterfall and pick_waterfall_2 == 'yes':
print('you step into the waterfall. You notice a shiny purple stone at your feet.')
pick_stone = input('Do you want to pick up the stone?')

This:

if pick_waterfall or pick_waterfall_2 == 'yes':
print('you step into the waterfall. You notice a shiny purple stone at your feet.')
pick_stone = input('Do you want to pick up the stone?')