hupili / python-for-data-and-media-communication-gitbook

An open source book on Python tailed for communication students with zero background
115 stars 62 forks source link

ValueError: list.remove(x): x not in list #155

Open MindyZHAOMinzhu opened 5 years ago

MindyZHAOMinzhu commented 5 years ago

ValueError: list.remove(x): x not in list

Describe your environment

I work on Exercise 1 and I meet a problem.

Describe your question

image image From my perspective, i is in the list1 and obviously it it in the student_list, but there is error.

Describe the efforts you have spent on this issue

I have Google it but I do not find some similar problem.

hupili commented 5 years ago

you can print list1 and student_list before the error line. Then you can verify whether x is in or not