■ Python – High-Level Programming Language
■ IDLE (Integrated Development and Learning Environment)
An interpreted language
• Interactive Mode – Used to write small code segments
• Script Mode – Used to write blocks of code
■ Python Statements
• Single-line statements → Used to perform a single action/operation
• Multi-line statements → Used when the code spans across multiple lines
■ Python Comments (Explanatory Information)
• Single-line Comments
- Written using # symbol
- Prevents Python from executing the code
Example: # This is a single-line comment
• Multi-line Comments
- Written using triple quotes (''' ''' or """ """)
- Used to add information in multiple lines
''' This is a multi-line comment '''
■■ Identifiers (Variables, Functions, Classes, Modules, etc.)
✔■ Valid Identifiers:
• Start with a letter or underscore, followed by letters, digits, or underscores
Example: my_name, age1, _total
■ Invalid Identifiers:
• Cannot start with a digit
• Cannot use Python keywords
• Cannot contain special symbols (@, #, $, etc.)
Example: 1add, else=5, @num