+ 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

13th Aug 2016, 6:10 PM
Sherif Radwan
Sherif Radwan - avatar
5 Respostas
+ 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
13th Aug 2016, 9:08 PM
Shekhar Nadar
Shekhar Nadar - avatar
+ 1
print("I love " (x));
14th Aug 2016, 3:10 AM
Jayvardhan Deshmukh
Jayvardhan Deshmukh - avatar
0
insert a space between the letter e and the closing quotation mark in the word love
13th Aug 2016, 6:26 PM
webnzero
webnzero - avatar
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.
13th Nov 2016, 8:09 AM
Lenze
Lenze - avatar
- 1
"hello" " world". (<- Like this)
13th Aug 2016, 7:00 PM
Jayvardhan Deshmukh
Jayvardhan Deshmukh - avatar