![]() |
VOOZH | about |
Prerequisite: BeautifulSoup Installation
In this article, we will scrape a quote and details of the author from this site using python framework called BeautifulSoup and develop a guessing game using different data structures and algorithm.
The user will be given 4 chances to guess the author of a famous quote, In every chance the user will be provided with a hint which can be the author's birth date, first name's first letter, second name's first letter, etc. On successfully guessing the author, a message is printed and if the user fails to guess the answer even after all the 4 chances then again a message is printed along with the answer.
Program:
Output:
Time Complexity:
The time complexity of this code is O(N) because the while loop is iterating over quotes list N times.
Space Complexity:
The space complexity of this code is O(N) because the all_quotes list is storing N number of elements.