Cheat sheet · Class 11 · CBSE · Science Computer Science
Getting Started with Python cheat sheet
The whole chapter on one page: key formulas, facts and the points to remember, for quick revision before a test.
CBSE Class 11 · Computer Science
Cheat sheet
Chapter 5Getting Started with Python
Everything in Python is an object with a type and an id.
1. Basics
- Interpreted, case-sensitive, high-level.
- Modes: interactive (>>>) and script (.py).
- Identifiers: letters, digits, _; can't start with a digit or be a keyword.
- Comments start with #.
2. Data Types
| Type | Example | Mutable? |
|---|---|---|
| int, float, complex | 5, 3.2, 2+3j | no |
| bool | True, False | no |
| str | 'hello' | no |
| list | [1, 2, 3] | yes |
| tuple | (1, 2) | no |
| dict | {'a': 1} | yes |
| set | {1, 2} | yes |
| None | None | — |
3. Operators & Precedence
| Category | Operators |
|---|---|
| Arithmetic |
|
| Relational | == != > < >= <= |
| Logical | and or not |
| Assignment | = += -= *= /= |
| Identity / membership | is, is not / in, not in |
Precedence: ** > unary - > * / // % > + - > relational > not > and > or.
4. Input / Output & Errors
- input() always returns a string — convert with int() / float().
- print(sep, end).
- Errors: syntax, logical, runtime (e.g. ZeroDivisionError).
5. Key Points
- 7 // 2 = 3, 7 % 2 = 1, 2 ** 3 = 8.
- Implicit conversion: int + float → float.
- type() and id() functions.
- Python 3: / always gives float.
Remember: Data types & mutability | operators | input() is str
Getting Started with Python: questions and notes
More Class 11 · CBSE · Science Computer Science cheat sheets
Practise Getting Started with Python
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed