list1 = []
while True:
num=input("enter a number or input q to quit or input a for the average\n")
if isinstance(num, int):
list1.append(num)
elif isinstance(num, str):
if num == "q":
exit()
elif num == "a":
print(list1)
else:
print("stop")
I'm a python beginner, and I've made this program to find the average of integers in a list, but for some reason it does not add any integers to the list. I don't know why it doesn't work