0
import random
print("\t\tWant to know your future?")
input()
fortune = random.randint(1, 5)
if fortune == 1:
print("You are gonna die today")
input()
elif fortune == 2:
print("You will find love")
input()
elif fortune == 3:
print("You will make it big today!")
input()
elif fortune == 4:
print("You friends will betray you!")
input()
elif fortune == 5:
print("They are comming to find you..")
input()
else:
print("Fuck the future...")
input()

I am trying to learn python and I am trying to make a simple fortune program. It is telling me there is a syntax error with elif, how am i using this wrong? The version of python I am using is 3.1. I am using a older version cause it goes with my book. Thanks for any help you can give me.

Edited by Nick Evan: Added CODE tags, delete double replies

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by pyguy62
0
import random
print("Want to know your future?")

fortune = random.randint(1, 5)
if fortune == 1:
   print("You are gonna die today")
elif fortune == 2:
   print("You will find love")
elif fortune == 3:
   print("You will make it big today!")
elif fortune == 4:
   print("You friends will betray you!")
elif fortune == 5:
   print("They are comming to find you..")
else:
   print("**** the future...")

idk if it was just your indenting or if you have another issue, you're not really giving us anything to help you with. And why did you post it 4 times?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.