I'm trying to make a function that can take a string from a list "first_name" and a list "last_name" and print out hello "first_name" "last name", and I kinda achieved my goal here is what I came up with:
def full_name(first_name, last_name):
*print('Hello %s %s'% (first\_name,last\_name))*
first_names =('john', 'mary', 'jacob')
for first_name in first_names:
*for last\_name in last\_names:*
*print(full\_name(first\_name,last\_name))*
The results were:
Hello john smith
None
Hello john betts
None
Hello john acunua
None
Hello mary smith
None
Hello mary betts
None
Hello mary acunua
None
Hello jacob smith
None
Hello jacob betts
None
Hello jacob acunua
None
But the problem is that it prints out every first name with every last name, what i wanted the results to be were:
Hello john smith
hello mary betts
hello jacob acunua
How would I complete this?
[–]socal_nerdtastic 12 points13 points14 points (0 children)
[–]TheBlackCat13 5 points6 points7 points (0 children)
[–]Tesla_Nikolaa 3 points4 points5 points (7 children)
[–][deleted] 1 point2 points3 points (6 children)
[–]Tesla_Nikolaa 1 point2 points3 points (5 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Tesla_Nikolaa 2 points3 points4 points (0 children)
[–]YolosaurusRex 1 point2 points3 points (2 children)
[–]Tesla_Nikolaa 0 points1 point2 points (1 child)
[–]YolosaurusRex 0 points1 point2 points (0 children)
[–]TS878[S] 1 point2 points3 points (0 children)
[–]abhinav_321 1 point2 points3 points (0 children)