0% found this document useful (0 votes)
22 views1 page

Python Basics: Statements and Identifiers

Uploaded by

bindupravaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Python Basics: Statements and Identifiers

Uploaded by

bindupravaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

■ 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

You might also like