0

NEXT QUESTION! HELP!

a=input Input = number ———— I want to make this: Life = Life - a Here's an error: Unsupported operand type(s) for -: 'int' and 'str'

29th Jun 2016, 1:10 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
15 Réponses
+ 1
put every character in ' ' dont put input in second line assign to any variable and use that
29th Jun 2016, 1:54 PM
Nishant Sardana
Nishant Sardana - avatar
0
put input() life is not previously define
29th Jun 2016, 1:30 PM
Nishant Sardana
Nishant Sardana - avatar
0
I have defined Life previously...
29th Jun 2016, 1:34 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
So... What I should do?
29th Jun 2016, 1:34 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
ok then only replace input by input()
29th Jun 2016, 1:35 PM
Nishant Sardana
Nishant Sardana - avatar
0
Input set by your precious message...
29th Jun 2016, 1:36 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
is message coming now too??
29th Jun 2016, 1:37 PM
Nishant Sardana
Nishant Sardana - avatar
0
My code is: a=input If input == 1 or 2: Points = points - a a=a*10 Health=a ————— Error in points = points - a
29th Jun 2016, 1:38 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
in second line in place of input put a
29th Jun 2016, 1:39 PM
Nishant Sardana
Nishant Sardana - avatar
0
Error in: Points = points - a
29th Jun 2016, 1:41 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
Other is ok
29th Jun 2016, 1:41 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
can u plz send full code.. then i will be able to help u better
29th Jun 2016, 1:43 PM
Nishant Sardana
Nishant Sardana - avatar
0
while points > 0: if input == "1" or 1: end() wow() print('_-=Текущие характеристики=-_') print('\nЗДОРОВЬЕ | ' + str(health)) hp = 10 wow() print('Курс конвертации:| 1 К ' + str(hp) + ' |') if points > 0: a=input('Сколько опыта ты желаешь потратить? ') if a == 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10: points = points-a a=a*10 health = a else: print(health)
29th Jun 2016, 1:48 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
Points is set to 10
29th Jun 2016, 1:49 PM
Xenonium Oxygen
Xenonium Oxygen - avatar
0
Thanks
29th Jun 2016, 2:00 PM
Xenonium Oxygen
Xenonium Oxygen - avatar