Hey Guys I keep on having syntax errors with Python, this is my first day doing python ever please give me grace

65 Views Asked by At

Im trying to do a madlib game and keep having syntax errors but Im following a video but getting a complete different result.

I tried to eliminate the error but it keeps on going to the next cursor

madlib(): print( "welcome to my mad lib")

pronoun1=input ("fans")
first name=input ("jeremy")
noun1=input ("tree")
last name=input ("thomas")
second pronoun=input("stars")
place=input ("broward")
third pronoun=input ("lions")
place2=input ("LA")
fourth pronoun=input("moons")
noun2=input ("chair")
adjective1=input("sharp")
adjective2=input("smelly")
verb=input("fighting")
adjective3=input("tall ")

print "hello there, sports",pronoun1, "this is" first name"talking to you from the press" noun1 "in" last name "stadium, where 57,000 cheering" second pronoun "have gathered to watch the" place third pronoun "take on the"  place 2 fourth pronoun "even though the"  noun2 "is shining, its a" adjective1 "cold day with the temperatrue in the" adjective2 "2os. We'll be back for the opening " verb "after a few words from our" adjective3 "sponsor"
1

There are 1 best solutions below

4
On

In the lines where you're asking for input, you should not include any spaces in the variable names. Instead of first name, you should use first_name, like this:

first_name = input("Jeremy")

In the print statement at the end, you should use parentheses around the string you're trying to print. Also, you're missing a plus sign in a few places where you're trying to concatenate strings. Here's a corrected version of the print statement:

print("Hello there, sports " + pronoun1 + ", this is " + first_name + " talking to you from the press " + noun1 + " in " + last_name + " Stadium, where 57,000 cheering " + second_pronoun + " have gathered to watch the " + place + " " + third_pronoun + " take on the " + place2 + " " + fourth_pronoun + ". Even though the " + noun2 + " is shining, it's a " + adjective1 + " cold day with the temperature in the " + adjective2 + " 20s. We'll be back for the opening " + verb + " after a few words from our " + adjective3 + " sponsor.")

These changes should help eliminate the syntax errors in your code.

I hope this helps and good luck with your project!