Python Forum

Full Version: General Coding Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a beginner at this course.

Getting "SyntaxError: invalid syntax"

Project code:

1. class = 8
2. print(class)

Program Result

C:\Users\BISWAJIT\PycharmProjects\NewJourney\venv\Scripts\python.exe C:/Users/BISWAJIT/PycharmProjects/NewJourney/Jit.py
File "C:\Users\BISWAJIT\PycharmProjects\NewJourney\Jit.py", line 1
class = 8
^
SyntaxError: invalid syntax

Process finished with exit code 1

May I get a reply from members on it
I think you are supposed to answer the question "Why is this a syntax error?" Have you tried looking up what "class" might mean in Python? Having someone tell you the answer is not going to help you.
Generally want to avoid keywords as variable names.