+ 1

Why my answer is not show " spameggs "

first string ="spam" second string ="eggs" print("First string" + "second string")

24th Apr 2020, 12:14 PM
Bruklin
Bruklin - avatar
3 odpowiedzi
+ 6
You are using quotation marks in your print statement. So you're creating new strings instead of accessing the variables. Also you have to write your variables in one piece: firststring
24th Apr 2020, 12:20 PM
HonFu
HonFu - avatar
+ 6
Because in the print function you're concatenating two string I.e first string+ second string together not two variables. For printing spameggs you need to write like this print(first_string + second_string) Remember you can't put space in the name of variable, it'll cause syntax error. Hope it helps
24th Apr 2020, 12:22 PM
Vishaka Saxena
Vishaka Saxena - avatar
+ 3
It is because you are putting the variable names in quotes which makes them a string. Also variable names don't include spaces. You have to write this instead... print(first_string + second_string)
24th Apr 2020, 1:55 PM
Varun Vaswani
Varun Vaswani - avatar