Am I Wrong or Is Pythonā€™s Training Exercise? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Am I Wrong or Is Pythonā€™s Training Exercise?

What about the space though? In the example they give before you do the exercise the program is written like so: >>> "Spam" + 'eggs' 'Spameggs' But in the other program for the exercise it says: >>> ā€œHelloā€ + ā€˜worldā€™ ā€˜Hello worldā€™ No the extra space in between Hello and world isnā€™t a typo thatā€™s how itā€™s written up. Could someone explain this to me?

21st Mar 2018, 5:14 PM
Jake
4 Respostas
+ 1
Hi Jake, I can tell you for a fact that the second command is definitely wrong. If you don't recall exactly how it was given, one possibility is that the strings were not concatenated, instead passed as arguments to the print() function, like so: print("Hello", 'world') One more thing I noticed is that the characters around ā€œHelloā€ and ā€˜worldā€™ actually aren't the regular quotes, so that could be something.
21st Mar 2018, 5:37 PM
Just A Rather Ridiculously Long Username
+ 3
I have looked it up. There is a space after Hello inside the quotes.
21st Mar 2018, 7:34 PM
Paul
Paul - avatar
0
Ok cool was jw, and Iā€™m ok with being wrong too šŸ˜‚. Constructive criticism is what I live for
21st Mar 2018, 6:57 PM
Jake
0
Anytime!
17th May 2018, 8:37 PM
Just A Rather Ridiculously Long Username