Why the code given below is not giving desired output. We want to input value as 10
and obtain output as 20. Could you pinpoint the problem? 2
Number = input(“enter number”)
DoubleTheNumber = Number * 2
Print(DoubleTheNumber)
Answers
Answered by
2
Answer:
Replace first line with,
Number = int(input(“enter number”))
Or, second line with,
DoubleTheNumber = int(Number) * 2
Explanation:
The program produced undesirable output because the number was not converted to integer.
Answered by
4
Answer:-
The Following program is not giving the desired output as the number was not converted to integer.Here number is a string variable and so it's not giving desired output.
Write this,
number=int(input("Enter number: "))
Then the problem will be solved.
Similar questions
Math,
2 months ago
Math,
2 months ago
India Languages,
5 months ago
Biology,
10 months ago
Business Studies,
10 months ago