1)def name(fname, mname, lname):
return “Hello, ” + fname + ” ” + mname + ” ” + lname
print(name(“James”, “Buchanan”, “Barnes”))
output – Hello, James Buchanan Barnes
2)def name(fname,mname,lname):
return “Hello,”+fname,mname,lname
print(name(“Joe”,”Peter”,”Quill”))
(‘Hello,Joe’, ‘Peter’, ‘Quill’)
please explain the output of second ? why is it in a tuple . When in the return statement I remove all commas with + the parentheses go way?
submitted by /u/FewNectarine623
[link] [comments]
r/learnpython 1)def name(fname, mname, lname): return “Hello, ” + fname + ” ” + mname + ” ” + lname print(name(“James”, “Buchanan”, “Barnes”)) output – Hello, James Buchanan Barnes 2)def name(fname,mname,lname): return “Hello,”+fname,mname,lname print(name(“Joe”,”Peter”,”Quill”)) (‘Hello,Joe’, ‘Peter’, ‘Quill’) please explain the output of second ? why is it in a tuple . When in the return statement I remove all commas with + the parentheses go way? submitted by /u/FewNectarine623 [link] [comments]
1)def name(fname, mname, lname):
return “Hello, ” + fname + ” ” + mname + ” ” + lname
print(name(“James”, “Buchanan”, “Barnes”))
output – Hello, James Buchanan Barnes
2)def name(fname,mname,lname):
return “Hello,”+fname,mname,lname
print(name(“Joe”,”Peter”,”Quill”))
(‘Hello,Joe’, ‘Peter’, ‘Quill’)
please explain the output of second ? why is it in a tuple . When in the return statement I remove all commas with + the parentheses go way?
submitted by /u/FewNectarine623
[link] [comments]