Notes · Class 11 · CBSE · Science Computer Science

Getting Started with Python notes

Revision notes for the chapter: the key points, definitions and exam tips to remember.

Python is a high-level, interpreted, easy-to-read programming language.

FEATURES

  • Free, open source, case-sensitive, portable, uses indentation for blocks.
  • Modes: interactive (>>> prompt) and script (.py files).

BASICS

  • Keywords (if, for, True, None…), identifiers (names: start with a letter or underscore, no spaces).
  • Variables: created by assignment (x = 5); dynamic typing.
  • Comments: # single line.

DATA TYPES

  • Numbers: int, float, complex. Boolean: True/False.
  • Sequences: str, list, tuple. Mapping: dict. None.
  • Mutable (list, dict) vs immutable (int, float, str, tuple).

OPERATORS

  • Arithmetic: + − * / // % **. Relational: == != < > <= >=.
  • Logical: and, or, not. Assignment: = += -=. Identity: is, is not. Membership: in, not in.
  • Precedence: ** highest; then unary, * / // %, + −, relational, not, and, or.

INPUT AND OUTPUT

  • input() returns a string; convert with int() or float().
  • print(value, sep=" ", end="\n").

TYPE CONVERSION

  • Explicit: int("5"). Implicit: 5 + 2.0 → 7.0.

ERRORS

  • Syntax, logical, runtime (ZeroDivisionError).
Memory hook: "Indentation is Python's punctuation."

Getting Started with Python: practice questionsGetting Started with Python cheat sheet

More Class 11 · CBSE · Science Computer Science notes

Practise Getting Started with Python

Sign up free to practise the full chapter after revising. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed