May-25-2021, 11:52 PM
i am trying to get the loop
to do if user press l go back to previous line
I've looked on the internet and can't find anything that did not pertain to math or advanced projects
and if I do while True:. it will give me nothing
and now i am getting an error on line 21
to do if user press l go back to previous line
I've looked on the internet and can't find anything that did not pertain to math or advanced projects
if choice=='s': print("ok you've choosen the sword. You see two doors. one is to the left and one is to the right") doors=input('Which door do you want to open? l or r ') if doors =='r': print('you are in an empty room. All there is you and your weapon of choice ') elif doors =='l': print("what are you doing here get out!"",""Some one yells. And punches you and stabs you. You have lost a live") lifes=lifes-1 print('You now have a life total of: ' + int(lifes)
and if I do while True:. it will give me nothing
and now i am getting an error on line 21
Error:Traceback (most recent call last):
File "main.py", line 21, in <module>
print('You now have a life total of: ' + lifes)
TypeError: can only concatenate str (not "int") to str
and here is out put for when i don't have the error and i use while trueOutput:Welcome to the fart monster game
----------------------------------
What is your name d
ok d here are the controls: g(grab),l(left),r(right),u(up),d(down)
press n to start n
----------------------------------------------
You are thrown into a dark room. All you have is a knife and a rope tied around on your wrists and you take the the knife and cut the rope and you find the light switch and turn it on and see a sword and a dagger
Which one do you want? s(sword) or d(dagger) s
ok you've choosen the sword. You see two doors. one is to the left and one is to the right
Which door do you want to open? l or r l
what are you doing here get out!,Some one yells. And punches you and stabs you. You have lost a live
>