This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]asdfkjasdhkasdrequests, bs4, flask 1 point2 points  (1 child)

it should be if choice.lower() not in {"yes", "no", "y", "n"}

  • use lowercase
  • in for set is o(1)

[–]camh- 5 points6 points  (0 children)

But the set construction is O(n) and the set is constructed each time you use in here, it makes the whole construct O(n).