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.

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.