I'm working on a project where I have to create a Mean, Median, Mode, and Range calculator and I keep failing to get the number from the user as input. Here's the code:
print("Mean, Median, Mode, and Range Calculator")
user_input = input("Press 1 to choose Mean , 2 to choose Median, 3 to choose Mode, and 4 to choose Range")
def get_num():
x = [input("Enter your numbers Without commas ie. 12 34 56: ")]
x1 = []
for i in x:
x1.append(int(i))
print(x1)
if user_input == '1':
pass
But I keep getting this error:
ValueError: invalid literal for int() with base 10: '12 34 56'
I've tried using a map, using for to loop through the list but it doesn't work. I don't even know what the error means can someone explain?