196k views
2 votes
def guest list(guests): for ___: ___ print(____.format(____)) guest list([('Ken', 30, "Chef"), ("Pat", 35, 'Lawyer'), ('Amanda', 25, "Engineer")])

1 Answer

4 votes

Answer:

Following are the missing code to this question:

for i in guests: #defining a loop for a print method parameter value

n, a, j= i#defining variable n, a, j that holds loop variable i value

print("{} is {} year old and work as {}.".format(n, a, j)) #print values

Output:

please find the attachment.

Step-by-step explanation:

In the given python code a method, "guest_list" is defined, that accepts one parameter, that is "guests", inside the method a for loop is used, inside the loop, an "i" variable is defined, that use method parameter variable.

In the loop, three variable "n, a, and j" is defined, which uses "i" to store its parameters value, and use the print method, to print its value with the message.

At the last step, the method "guest_list" is called, which accepts a list in its parameters.please find the attachment for the full code.

def guest list(guests): for ___: ___ print(____.format(____)) guest list([('Ken', 30, &quot-example-1
def guest list(guests): for ___: ___ print(____.format(____)) guest list([('Ken', 30, &quot-example-2
User Olsonist
by
4.9k points