Hey, I just got the newest version of python, Python 3.1.
I am getting the craziest, most out-there syntax errors ever, and I have no idea what to do.
Okay, here's a section of code that i just wrote to prove how crazy these errors really are:
import random
your_name = input("What is your name?")
nicknames = ("Fruitcup", "Captain", "Bunny", "Mama", "Dummkopf")
nickname = random.choice(nicknames)
or_not = input("Do you mind if I call you", nickname, "?")
if or_not == ("yes"):
print ("Fine
then,", your_name, ".")
answer = input("""
Answer this
then,
""", your_name, """:
\tIf two ducks have 5 ducklings, and three of those ducklings have\n
\t10 ducklings each, how many ducks do you have in total\n""")
if answer == ("39"):
your_name += ("sky")
print ("Congratulations
,", your_name, ". You're smart!")
answer_dos = input("Would you like to see the solution?")
if answer_dos == ("yes"):
print """
We have the mother and father duck, the three ducklings and their
spouses, and the thirty grand-ducklings, a total of 39 ducks.
"""
else:
print ("So long then!")
else:
print ("You are terrible at math.")
okay, all the things hi-lighted in red are the things that python is saying is a syntax error. the indenting is not right because i copied and pasted it, but you guys get the general idea:
import random
your_name = input("What is your name?")
nicknames = ("Fruitcup", "Captain", "Bunny", "Mama", "Dummkopf")
nickname = random.choice(nicknames)
or_not = input("Do you mind if I call you", nickname, "?")
if or_not == ("yes"):
print ("Fine then,", your_name, ".")
answer = input("""
Answer this then,""", your_name, """:
\tIf two ducks have 5 ducklings, and three of those ducklings have\n
\t10 ducklings each, how many ducks do you have in total\n""")
if answer == ("39"):
your_name += ("sky")
print ("Congratulations,", your_name, ". You're smart!")
answer_dos = input("Would you like to see the solution?")
if answer_dos == ("yes"):
print """
We have the mother and father duck, the three ducklings and their
spouses, and the thirty grand-ducklings, a total of 39 ducks.
"""
else:
print ("So long then!")
else:
print ("You are terrible at math.")
Like, what is up with that!!?!??!?!?!
Okay, I'm pretty new to programming in general. I was a script kiddie with batch files and .vbs for a while, until i decided i wanted to do something besides making lame joke viruses and putting them on my sister's computer. I've had lots of problems so far, but i've been able to work through them all. Except for this. I've put hours into trying to fix this and nothing works. Please, i just need a little help. Even if you only know what not to do, but not nescesarily how to fix the problem, then by all means comment. any and all comments are appreciated. thanks!!