0

I have a problem in python

Plz see the codes dows below and give me the solution why Cant I do this ??? Also I have another code that doesn't work. Writing it down...... x=input() x +=3 print(x) this doesn't work. Also I have another code x= 5 x -= input() print(x) Also I another code. x= 5 y=x+8 print(y) Why these codes doesn't work Also this doesn't. Plz find me a solution why cant I do this ???

20th Oct 2020, 6:49 PM
Umar Haque
Umar Haque - avatar
3 Answers
+ 5
x = int(input())
20th Oct 2020, 6:57 PM
Shadoff
Shadoff - avatar
+ 3
x = input() will assign a string to x You can try x = int(input())
20th Oct 2020, 6:57 PM
Aravind Shetty
Aravind Shetty - avatar
0
Umar Haque If u leave them bare they will be assigned as strings
21st Oct 2020, 12:10 AM
Desmond Ampomah
Desmond Ampomah - avatar