What does it means ( " " ) ? Does it gives the space between 2 words | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What does it means ( " " ) ? Does it gives the space between 2 words

defĀ my_function(fname, lname): Ā Ā print(fname +Ā " "Ā + lname) my_function("Emil",Ā "Refsnes") Output. Emil Refsnes

25th Dec 2022, 2:57 AM
Nick
4 Respostas
+ 3
Nick , there is also a way to get the same result, where we can omit the concatenation of a space: ... print(fname, lname) by using the comma notation, the arguments in the print(..., ...) function are displayed with a space inbetween. an other advantage of this notation is that we can also use, output and combine string literals and numerical values without convert them to string. fname = 'tom' lname = 'smith' age = 34 print(fname, lname, age) # output=> tom smith 34
25th Dec 2022, 11:49 AM
Lothar
Lothar - avatar
+ 2
Yes thatā€™s correct.
25th Dec 2022, 3:06 AM
Lwez
Lwez - avatar
+ 1
Thanks
25th Dec 2022, 3:07 AM
Nick
+ 1
Wow! Thanks. Happy, Merry Christmas
25th Dec 2022, 6:50 PM
Nick