Question: Develop a Python fortune teller program for a user. Requirements: 1. the program will interact with the user a. prompt for a number (a counting

Develop a Python fortune teller program for a user.

Requirements: 1. the program will interact with the user a. prompt for a number (a counting number) i. if an empty string is returned, exit saying "Goodbye!" ii. verify the returned number is a positive integer do this test directly in main or use a try/expect block (in main) if there is a problem, inform the user what it is then allow the user to try again 2 more times After 2 more times failing exit with "try again later!" if it is not a problem then convert it to an int b. send that number to the function get_fortune() which will either return the fortune corresponding by that number as a string, or if the passed value is out of range, i.e., beyond the number of fortunes get_fortune maintains, then the fortune returned is "you get no fortune today" c. get_function() will maintain more than 5 fortunes d. the main program should not know how many fortunes get_function() maintains

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!