+ 1

Hey guys I'm new at coding. Can someone please explain to me why this code isn't working?

https://code.sololearn.com/c5kl3C02cvNV/?ref=app

24th Oct 2018, 11:06 AM
Monsieur Grisu
Monsieur Grisu - avatar
3 odpowiedzi
+ 1
OK so I'm going to assume that you want to take away the user input from ten. The problem is that 10 is an integer value and the rest is a string value and you cannot take one away from the other. Therefore you could simply replace str with int and it should work
24th Oct 2018, 11:11 AM
PureLogicality
PureLogicality - avatar
+ 1
You can't subtract string from integer. Try to use int(...) instead of str(...).
24th Oct 2018, 11:11 AM
microBIG
microBIG - avatar
0
ok thx GreenGem and microBig now it works
24th Oct 2018, 11:13 AM
Monsieur Grisu
Monsieur Grisu - avatar