Ask Question

What will be the output after the following code is executed?

def pass_it (x, y):

z = x + ", " + y

return (z)

name2 = "Tony"

name1 = "Gaddis"

fullname = pass_it (name1, name2)

print (fullname)

A) Tony Gaddis

B) Gaddis Tony

C) Tony, Gaddis

D) Gaddis, Tony

+2
Answers (1)
  1. 25 October, 10:37
    0
    D) Gaddis, Tony

    Explanation:

    - When you look at the function pass_it, it takes two arguments and returns these arguments with a comma between them.

    - name1 and name2 variables are assigned as Gaddis and Tony.

    fullname variable calls the the pass_it and gives above variables as arguments.

    fullname variable (which is now equal to Gaddis, Tony) is printed.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What will be the output after the following code is executed? def pass_it (x, y): z = x + ", " + y return (z) name2 = "Tony" name1 = ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers