foo = input("enter a number") print("enetered no is:"(foo)). Am getting error how to execute this with an output as.Enterednois | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

foo = input("enter a number") print("enetered no is:"(foo)). Am getting error how to execute this with an output as.Enterednois

20th May 2017, 10:23 AM
sai charan tej
sai charan tej - avatar
2 Answers
+ 3
use the print function like this: print("Entered number is:", foo) EDITED: if both statements are in the same line separate them with a ';'
20th May 2017, 10:29 AM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
foo=input("Enter a number") print("Entered No Is: " + foo) For multiple input and string/integer combos use format.. foo=input("Enter a number") foo2=input("Enter another number") print("You entered {} and {}".format(foo,foo2))
20th May 2017, 2:17 PM
LordHill
LordHill - avatar