Python Lesson Loops Exercise 4. Simple errors


#1

https://www.codecademy.com/courses/python-beginner-en-cxMGf/0/4?curriculum_id=4f89dab3d788890003000096#

I think I code the while conditions just right.

choice = raw_input('Enjoying the course? (y/n)')

while choice != 'y' or choice != 'n':  # Fill in the condition (before the colon)
    choice = raw_input("Sorry, I didn't catch that. Enter again: ")

But why does it keep looping?


#2

use the and operator instead of the or operator. :slight_smile:


#3

Well I just realized that the instruction clearly says 'AND'. Also that makes sense. Thanks for having me realize that mistakes!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.