- 1
HOW TO INSERT SPACE BETWEEN THESE WORDS IN THIS CODE ?
name = "James" age = "42" print( name + "is" + age + "years old")
6 odpowiedzi
+ 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)