Just started to learn how to code.I was trying to use remove() in for loop to remove the specific value if condition met but the result is what I expected
student = ["A", "B", "C"]
bad = input("who is absent?: ")
for i in student:
if i in bad:
student.remove(bad)
else:
print(i)
The result looks like this if I typed A in input
who is absent?: A
C
I was expecting the out to be something like
who is absent?: A
B C