📎 Referral Code:
📊 Dashboard Sign In
Navigation
🗺️
Courses
🎬
Short Videos
💡
Pro Tip Videos
Job Support
🎯
Interview Board
AI Tools
🌐
Website Link Agent
🛟
Support Works
Home
Python Introduction
Python Syntax & Reserved Keywords
Python Introduction Python Syntax & Reserved Keywords
Python Syntax & Reserved Keywords
Python Introduction
06:27
Now Watching
Previous
← Previous
Python Installation
Lesson Progress
🎉 Section Done!
See next section →
🎉 You've completed Python Introduction!
Great work! Select the next lesson from the sidebar to continue your journey.
📄 View Reference Document & Notes

📋 Lesson Notes & Resources

Python Syntax and Reserved Keywords

🔹 What is Python Syntax?

Python syntax defines how Python code should be written and formatted. If the syntax is incorrect, the Python interpreter will raise errors.

Rule Explanation Example
Indentation is required Python uses spaces/tabs instead of braces {}
if 5 > 2:\n    print("Five is greater")
Case-sensitive Name and name are different
name = "John"\nName = "David"
Statements end with newline No semicolon (;) required print("Hello")
Comments Start with # # This is a comment
Variable declaration No var keyword, just assignment x = 10

🔑 Python Reserved Keywords

Keywords are special reserved words that cannot be used as variable or function names. They are part of the Python language syntax.

False      await      else       import     pass
None       break      except     in         raise
True       class      finally    is         return
and        continue   for        lambda     try
as         def        from       nonlocal   while
assert     del        global     not        with
async      elif       if         or         yield
You cannot use these keywords as variable names.
They are case-sensitive and used internally by Python.

🧪 Check Keywords in Python

To list all keywords using code:

import keyword
print(keyword.kwlist)

🚫 Invalid Keyword Usage

Trying to use a keyword as a variable name results in an error:

def = 10  # ❌ Invalid: 'def' is a reserved keyword

✅ Correct way:

my_def = 10
Course Content
2 lessons