Ask coding questions

← Back to all posts
I am a pretty new PY coder, and I was wondering how to fix this bug.

The function ":" has an Invalid Syntax.

Answered by FishballNooodle [earned 5 cycles]
View Answer

The error shown in the picture is different from the error when I ran the repl.

The ERROR in the picture

You used the def keyword to define the function.
It should generally (based on PEP 8) should look something like this.

You should also be using input to get user input
age = int(input("Enter in your age: "))

Do note that copying code outside of replit into replit may not work as replit works slightly different when it comes to Package/Modules/File Handling. This explains why there is another error when the repl is being run (Circular Import)

You may also want to try considering making your own program from scratch so you learn faster instead of trying to understand other people's code.