- 1
HOW TO INSERT SPACE BETWEEN THESE WORDS IN THIS CODE ?
name = "James" age = "42" print( name + "is" + age + "years old")
6 Answers
+ 3
Specify a relevant programming language name in the tags, don't write your code into the tags please â
+ 1
thanks all
+ 1
print(name,"is",age,"years old")
0
Háşu Trần VÄn
name = "james"
age = 21
print("my name is {0} and age {1} ".format(name,age))
0
name = "jhon"
age = 1000
print("%s is %d years old" %(name, age))
- 1
in python you can use f-string formatting.
name=âJamesâ
age=42
sentence=fâ{name} is {age} years oldâ
print(sentence)