Python Forum
General Coding Help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: General Coding Help (/thread-34723.html)



General Coding Help - biswajitmaity - Aug-25-2021

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


RE: General Coding Help - deanhystad - Aug-25-2021

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.


RE: General Coding Help - jefsummers - Aug-25-2021

Generally want to avoid keywords as variable names.