0

input problem

guy, can you find the problem? s=input()*2 a=input()*s b=(input()+a)-2 print(s) print(a) print(b)

21st Oct 2016, 12:39 PM
Ricardo Simplicio
Ricardo Simplicio - avatar
4 Answers
+ 5
input returns what you typed as a string. You have to convert the input to an int before using it in an expression. s=int(input())*2 a=int(input())*s b=(int(input())+a)-2 print(s) print(a) print(b)
21st Oct 2016, 1:00 PM
Zen
Zen - avatar
+ 1
Every input is a string type. Even if you input a number. If you want another type, you have to convert the input. example: a = input () # input f.e. 5 b = int (a) # here you convert the string '5' to integer 5
21st Oct 2016, 1:02 PM
Amarie
0
guy i'm impressed!! thank you!!
21st Oct 2016, 6:53 PM
Ricardo Simplicio
Ricardo Simplicio - avatar
- 1
_"hi" pls give the answer
21st Oct 2016, 3:57 PM
Kutub Uddin Kayef
Kutub Uddin Kayef - avatar