+ 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 odpowiedzi
+ 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