Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random fortune
#1
Im making a random fortune teller for my class this is what I have so far can someone fix it for me? Also if you could make it 10 fortunes it needs to be 10 lol

ie.
def MyFortune () :
    print ("Welcome to my cool fortune teller")
    print ("This program is guaranteed to predict your future")

    color = raw_input("Select a color: red, blue, green, or purple: ")

    if color == "red" or color == "green":
        number = int(raw_input("Select a number: 1, 2, 5, or 6: "))
        if number == 1:
            print ("You will be very, very rich!")
            elif number == 2:
                print ("You will become a jedi master!")
                elif number == 5:
                     print ("you will live a poor life")
                    elif number == 6:
                        print ("you will become president")
                        else:
                            print ("you must enter 1, 2, 5 or 6")
                            elif color == "blue" or color == "purple":
                                number = int(raw_input("select a number: 3, 4, 7, or 8"))
                                if number == 3:
                                    print ("you will die")
                                    elif number == 4:
                                        print ("you will live a poor life")
                                        elif number == 7:
                                            print ("you will become a wizard")
                                            elif number == 8:
                                                print ("you will save the earth")
                                                else:
                                                    print ("you must enter 3, 4, 7, 8")

                                                    else: print "you must enter a correct color: red, blue, green or purple"
Reply


Messages In This Thread
Random fortune - by jackthechampion - Feb-10-2020, 05:25 AM
RE: Random fortune - by perfringo - Feb-10-2020, 07:52 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020