Loading notes...
Loading notes...
Class 11 • Chapter 3
Chapter 3 introduces the Python programming language, highlighting its features, execution modes (Interactive vs. Script), and the fundamental building blocks of code known as Tokens.
Python was created by Guido van Rossum and first released in 1991. It is a high-level, interpreted, general-purpose programming language. Python's design philosophy emphasizes code readability through its notable use of significant whitespace (indentation). It is wildly popular in fields ranging from Web Development to Artificial Intelligence and Data Science.
3.1 Features of Python
Python has several key characteristics that make it an excellent choice for both beginners and industry professionals:
3.2 Execution Modes
You can interact with Python in two primary ways: Interactive Mode and Script Mode.
3.3 Python Tokens
In a Python program, the smallest individual unit of code is called a Token. The Python interpreter breaks your code down into tokens before executing it. There are five main categories of tokens.
3.4 Rules for Naming Identifiers
When creating a name for a variable or function (an identifier), you MUST follow strict Python rules. If you break these rules, Python will throw a SyntaxError.
# Valid Identifiers
player_score = 100
_hidden_value = 5
name2 = "Alice"
# Invalid Identifiers
# 2nd_player = 50 (Starts with a number)
# total-cost = 20 (Contains a hyphen/minus sign)
# class = "11th" ('class' is a reserved keyword)