Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Why syntax error
Is it because of indenting or error in code im not very good at indenting years_ahead = input("type many years do you want to pass by") print("new ages of the gang") age = {"Bob": 30, "Dob": 24, "Mob": 31} def aging(x, y, z): xx = x + int(years_ahead) yy = y + int(years_ahead) zz = z + int(years_ahead) if xx >= 90: print(str(x) + ":dead") print(str(x) + "\'s corpse age:" + str(xx)) else: print(str(x) + (":") + str(xx)) if yy >= 120: print(str(y) + ":dead") print(str(y) + "\'s corpse age:" + str(yy) else: print(str(y) + (":") + str(yy)) if zz >= 110: print(str(z) + ":dead") print(str(z) + "\'s corpse age:" + str(zz)) else: print(str(z) + (":") + str(zz)) aging(age["Bob"], age["Dob"], age["Mob"]) 
9 Answers
+ 5
Which error exactly?
+ 5
Line 17 ) missing
+ 4
Try to delete braces
":" instead of (":")
+ 1
it says this
File “./Playground/file0.py”, line 18
else:
^
SyntaxError: invalid syntax
+ 1
yeah and “:” didnt work
0
invalid syntax
0
line 18
0
what
0
wait oh i get it thanks brother