+ 1
how to make a space between a string and variable?
when I write x=ice cream print("I love"+(x)) the output is : I loveicecream
5 Answers
+ 1
1st point you should use quotes whenever you define a string.
2nd no need to put "+" to add 2 spring if you want to add them, just add comma just after 1st string and write 2nd one. comma acts a space
+ 1
print("I love " (x));
0
insert a space between the letter e and the closing quotation mark in the word love
0
x='ice cream'
print("I love"+' '+ x)
# add a string with just a single blank space.
# the output is : I love ice cream
# this is one way of doing this.
- 1
"hello" " world". (<- Like this)