My code for this returns 'None'. In case my question is not clear if i take the list [1 , 3 , 4 , 5 ,5 , 7], I want the list [1 , 3 , 4 , 7] to be returned. My code is as follows:
print("This program takes a list of 5 items and removes all elements of 5: ")
list4 = []
list4.append(input("Please enter item 1:"))
list4.append(input('Please enter item 2:'))
list4.append(input('Please enter item 3:'))
list4.append(input('Please enter item 4:'))
list4.append(input('Please enter item 5:'))
def remove_five():
while 5 in list4:
list4.remove(5)
print(remove_five())