0

s=input("enter a no.")>>>s*'4'

why doesn't👆run?

20th Dec 2016, 11:46 AM
Sourav Ray
Sourav Ray - avatar
2 Answers
0
If you run it on a Python software it should tell you what the problem is or at least where it is located.
20th Dec 2016, 3:07 PM
Levi
Levi - avatar
0
The input function returns a string, and you are trying to multiple 2 strings together. If you are trying to multiply the number entered by 4 you will first need to convert it. in one line you could do: s=int(input ("Enter a no.")) print(s*4) note that if you enter a string that is not a number your program will crash. or alternatively to see what is happening: s=input("Enter a no.") x = int(s) print(x * 4)
21st Dec 2016, 10:24 AM
Elric Hindy
Elric Hindy - avatar