24.7k views
5 votes
Question # 1

Multiple Choice

What will be the output of the following program?

def average(a, b):

total = a + b

return total / 2


ave = average(7,11)

print("Total", total)

print ("Average", ave)



A. an error statement since total's scope is limited to the average function.
B. Total 18
​Average 9
C. Total18
​Average9
D. an error statement since average is a keyword.

User Arete
by
6.6k points

2 Answers

2 votes

Answer:

an error statement since total's scope is limited to the average function.

Explanation:

The scope of total is the function average. Code outside of the function does not have access to its value.

Correct answer edge 2020

User Sfiss
by
6.2k points
4 votes

Answer:

an error statement since total's scope is limited to the average function.

Step-by-step explanation:

The scope of total is the function average. Code outside of the function does not have access to its value.

Correct answer edge 2020

User Pjmorse
by
7.1k points