Hi, I am a beginner coder and I want to use functions in my code, however there is an obvious problem.
code:
num1 = 50
num2 = 10
num3 = 5
num4 = 0
num5 = 0
def one(two):
return(f"""Stats:
health {num1}
defense {num2}
damage {num3}
madness {num4}
rage {num5}
""")
variable1 = input("""What would you like to do?
You can Run, Show Stats, Attack: """)
variable1 = variable1.lower()
if variable1 == 'run':
print('battle has ended')
elif variable1 == one:
print('stats shown')
elif variable1 == 'attack':
print('you attacked')
else:
print("You've inputted something wrong! Try again.")
the error is the elif variable1 == one
, if it doesn’t make sense whatsoever please reply.
I’m trying to use functions because for a game that i am creating here, my superior says that i should be using functions in order to make the code look cleaner.
All help is greatly appreciated.