Lecture 5: Python Syntax and Basics
Download & Installation Python IDE
Syntax of Python
Python's syntax is the set of rules that defines how a Python program is constructed. It is known for its readability and straightforward structure, making it a popular choice for both beginners and experienced programmers.
- Whitespace and Indentation: Python uses indentation to define blocks of code, which makes the code visually appealing and easy to understand.
- Case Sensitivity: Python is case-sensitive, meaning Variable and variable are two different identifiers.
- Statements and Expressions: A statement is an instruction that the Python interpreter can execute, such as print. Expressions are combinations of values and functions that are interpreted and evaluated to produce some other value.
- print() is a built-in function in Python that outputs text or other data to the console.
- Syntax: print(value, sep=' ', end='\n')
- value: The value(s) to be printed.
- sep: String inserted between values, default is a space.
- end: String appended after the last value, default is a newline.
×