new_artist_choice = choice print(str(choice) + ": Search for new artist") end_choice = choice + 1 print(str(end_choice) + ": End program") next_choice = None choice_number = 0 while True: next_choice = input("Select a Word Cloud to display: ") while next_choice != 'A' and (not str.isdigit(next_choice) or int(next_choice) > end_choice): print("Input was not one of the valid choices") next_choice = input("Select a Word Cloud to display: ") if next_choice == 'A': plt.imshow(rap_genius_artist.get_word_cloud(), interpolation='bilinear') plt.title(rap_genius_artist.get_artist_name()) plt.axis("off") plt.show() else: choice_number = int(next_choice) if choice_number == new_artist_choice or choice_number == end_choice: break i = 1 for album in rap_genius_artist.get_albums(): if choice_number == i: plt.imshow(album.get_word_cloud(), interpolation='bilinear') plt.title(album.get_album_name()) plt.axis("off")