The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #86
The in keyword is generally used to check whether an element is part of another one. Under the hood, Python will use the methods __contains__(self, item) , __iter__(self) , and __getitem__(self, key) of the biven substrings and strings objects. (stackoverflow.com/questions/3437059/does-python-have-a-st...)
How to check whether a substring is part of a string?
— The Python Quiz (@thepythonquiz) January 12, 2021
if "substring" contains "substring":
if "sub" is in "substring":
if "sub" in "substring":
π Comment the answer, like and retweet!
Question difficulty: π΅π΅π΅π΅π΅