A simple program asking the user questions and using their answers to build up a fortune telling in a list Introduction The first line allows us to use the sleep commands to pause our program. The report=[ ] creates a list to store our fake fortune telling.
Getting the users name The second line creates a variable called name which will store what ever the user types into the input box. The last line adds the name into the list called report
Telling the users fortune In the first line we ask a simple question and put the users answer into the variable q1 In the second line we see if the user has put an n inside our variable q1. If they have then we append you need to avoid cats to our report list. In the fourth line we see if the user has put an y inside our variable q1 and if they have we append we see a furry friend in your life to our report list.
Telling the fortune This line prints the report list item by item. 0 is the users name 1 is the line from the if elif else choice
See if you can create more questions and append more lines onto the users fortune. You will need to adjust the print statement that tells the fortune Finally test and DEBUG |