def numbers():
num = []
more = 'yes'
while more == 'yes':
amount = input("Give me a number!")
amount = int(amount)
num.append(amount)
more = input("Do you have anymore numbers you want to put in?")
if more == 'no':
print('ok')
if more == 'yes':
more = 'yes'
return num
def Math(num):
return min(num)
return max(num)
from statistics import mean
return mean(num)
numbers()
Math1 = Math(num)
print("The minimum, maximum and average is", Math1)
#For some reason the code does not recognize my "num" list. Im not sure as to why because what its supposed to do is find the minimum, maximum, and average of the list that is filled with random numbers by the user.
NameError Traceback (most recent call last)
<ipython-input-28-d9aba5506cc2> in <module>
20
21 Numbers1 = numbers()
---> 22 Math1 = Math(num)
23
24 print("The minimum, maximum and average is", Math1)
NameError: name 'num' is not defined