Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Coding Help
#1
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
Reply
#2
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.
Reply
#3
Generally want to avoid keywords as variable names.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  General coding Ellimann 2 2,395 Aug-25-2020, 05:43 AM
Last Post: buran
  General coding help prathmesh 1 1,898 Apr-01-2020, 01:23 PM
Last Post: buran
  general coding error karai 1 2,556 Mar-21-2018, 06:36 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020