Hi, I need to write a Python function that takes in a list of numbers, and outputs them into two lists, one consisting of even numbers, and the other odd numbers. I have managed to do a simple coding that works but when i tried to move it into a function, it doesn't work. Would appreciate your kind assistance.
import statistics import random original_list = [random.randint(1,1000) for x in range(0,100)] print("Original list:", original_list) def oddandeven(numbers_list): even_numbers = [] odd_numbers = [] for number in numbers_list: if number % 2 == 0: even_numbers.append(number) else: odd_numbers.append(number) return even_numbers return odd_numbers print("Odd:", oddandeven(original_list)) print("Even:", oddandeven(original_list))