+ 2

Input in python solvings

So basically i was solving a problem where i wrote something like pcount=input() brushcost=40 pcost=pcount*5 sumcount= 40 + pcost tax=(10*sumcount)/100 paintsolve=sumcount-tax It told me that pcount is a str, not int, and i was trying to make smthing likr adding str and int Did i just do input wrong? ( i was off from python for a while)

21st Aug 2021, 5:01 AM
Кроссовок
Кроссовок - avatar
2 Réponses
+ 9
input will always give you a string type, you need to convert it to a number. pcount = int(input())
21st Aug 2021, 5:02 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Of course! My bad, sorry, thank you!
21st Aug 2021, 5:03 AM
Кроссовок
Кроссовок - avatar