- 1

HOW TO INSERT SPACE BETWEEN THESE WORDS IN THIS CODE ?

name = "James" age = "42" print( name + "is" + age + "years old")

15th Mar 2021, 5:24 AM
Hậu Trần Văn
Hậu Trần Văn - avatar
6 odpowiedzi
+ 3
Specify a relevant programming language name in the tags, don't write your code into the tags please ☝
15th Mar 2021, 5:28 AM
Ipang
+ 1
thanks all
15th Mar 2021, 5:37 AM
Hậu Trần Văn
Hậu Trần Văn - avatar
+ 1
print(name,"is",age,"years old")
15th Mar 2021, 5:37 AM
visph
visph - avatar
0
Hậu Trần Văn name = "james" age = 21 print("my name is {0} and age {1} ".format(name,age))
15th Mar 2021, 5:34 AM
Sâgærāvürï
Sâgærāvürï - avatar
0
name = "jhon" age = 1000 print("%s is %d years old" %(name, age))
16th Mar 2021, 8:51 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar
- 1
in python you can use f-string formatting. name=“James” age=42 sentence=f”{name} is {age} years old” print(sentence)
15th Mar 2021, 6:26 AM
you are smart. you are brave.
you are smart. you are brave. - avatar