0
How can i ask for user input and add a string infront
If i ask how old are you it should bring John is: 40 years old
4 Réponses
+ 4
a=input("how old are you")
print("John is: {0} years old".format(a))
+ 3
name = input("Enter name here: ")
age = int(input("Enter age here: "))
print(f"{name} is {age} years old.")
# use this shortcut to concatenate.
+ 2
Vhaicko dxhemur
try:
s=str(input(""))
print("Your string is "+s)
except :
print("somesing wrong")
+ 1
Try using 'input()'.
#code:
age = input()
print(age)
#code end.
Run this in the playground