print("Enter your number") inpnum=input() print("you have entered", int (inpnum)+10) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

print("Enter your number") inpnum=input() print("you have entered", int (inpnum)+10)

This is a very basic code but it's not working. Is this code wrong?

4th Sep 2022, 6:26 AM
ssg
3 Answers
+ 1
text = int(input("Enter a number: ")) print(f"You entered {text + 10}")
4th Sep 2022, 6:37 AM
Sreeju
Sreeju - avatar
0
It works for me
4th Sep 2022, 6:40 AM
AjaraGuju
AjaraGuju - avatar
0
Your code is working for me, if the input is a number.
4th Sep 2022, 6:41 AM
Paul
Paul - avatar