I am doing a little side project, and i wanted to modify a inputed list (make it even or odd) after that i want to compare it to another list and delete lsit elements that appear in both and give a result list
i = list(range(1,51))
even_numbers = [str(number) for number in i if number % 2 != 1]
i=even_numbers
test_list = i
remove_list = list(int(x) for x in input("Enter elements separated by space:").split())
print("The test list is : " + str(test_list)) #For checking the list is correct
print("The remove list is : " + str(remove_list)) #For checking the list is correct
res = [i for i in test_list if i not in remove_list]
print("The list after performing remove operation is : " + str(res))
i = res
print(i)
i can do each req seperatly but when i try to make it run at the same time i get a resulted list without deletting any elements from the user inputed list
req1>i wanted to modify a inputed list (make it even or odd)
req2>i want to compare it to another list and delete list elements that appear in both and give a result list
Aashish Arun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.