I'm trying to run a code to figure out some statistics using the statistics module. I got to this problem about circular imports. I don't know what it is and how I can fix it.
#Statistics
import statistics
numbers = []
num_of_num = input('''How many numbers are in your list?
*Put a whole number, otherwise the command won't run the way you want it to*''')
for i in range(int(num_of_num)):
if i == 0:
number = input('What is your first number?')
else:
number = input('What is your next number?')
numbers.append(float(number))
statistics.mean(numbers)
statistics.median(numbers)
statistics.multimode(numbers)
min(numbers)
max(numbers)
max(numbers) - min(numbers)
sum(numbers)
I got this error:
AttributeError: partially initialized module 'statistics' has no attribute 'mean' (most likely due to a circular import)
I'm pretty sure the Statistics module has the mean attribute, so I don't know how to fix it and what I did wrong.