Getting Started with Python
Class 11 · Computer Science
4 ideas in Class 11 Computer Science, explained in plain words, with games and quizzes to practise.
First Steps
Part of: Python Basics
Python runs line by line; print shows output; comments explain; IDLE interactive and script modes.
Why it matters. First programs run. Modes known.
Key words
- Script execution
- : Reading and running a program line by line from the top.
- Print output
- : Showing output text on the screen for the user.
- Comment
- : Notes ignored by Python that explain code to readers.
- Interactive and script
- : Trying code instantly versus running saved files.
Try it in two minutes
- Open IDLE.
- Print hello.
- Save script.
Try at home. Print your name.
Variables and Types
Part of: Python Basics
Variables name storage; int, float, string, bool types; dynamic typing assigns freely; naming rules apply.
Why it matters. Data stored typed. Names valid.
Key words
- Variable
- : A named box storing one value for reuse in code.
- Data types
- : Whole numbers, decimals, text and true-false kinds of data.
- Dynamic typing
- : Python fixing the type from the value without declarations.
- Naming rules
- : Letters, digits and underscore with no leading digit or space.
Try it in two minutes
- Name validly.
- Assign values.
- Check types.
Try at home. Name five variables.
Operators and Expressions
Part of: Operators and IO
Arithmetic, relational, logical operators combine values; precedence orders work; floor, modulo, power vary.
Why it matters. Values computed. Order respected.
Formulas
- ** ranks first, then *, /, // and %, then + and -.
- Parentheses override precedence; the innermost part evaluates first.
- Equal-precedence operators evaluate from left to right.
- 13 % 5 leaves 3; 13 // 4 gives 3; 3 ** 4 is 81.
Key words
- Arithmetic operator
- : Symbols like +, -, * and / combining values into results.
- Modulo
- : The % operator returning the remainder of a division.
- Floor division
- : The // operator returning the whole quotient without decimals.
- Exponent
- : The ** operator raising the left value to the right power.
- Precedence
- : The order deciding which operator applies first.
Try it in two minutes
- Spot operators.
- Apply precedence.
- Compute result.
Try at home. Evaluate five sums.
Input Output Conversion
Part of: Operators and IO
Input reads text; convert with int, float, str; print shows results; joining needs same types.
Why it matters. Users feed data. Types converted.
Key words
- Input reading
- : Reading typed text, always as string unless converted.
- Type conversion
- : Changing text to int or float before arithmetic.
- Same-type joining
- : Joining needs matching types, else convert first.
Try it in two minutes
- Read input.
- Convert type.
- Print result.
Try at home. Input your age.
What your child will practise
- First Steps: Space Puzzle (Clue Puzzle)
- First Steps: Space Quick Fire (Quick Fire)
- Input Output Conversion: Ocean Puzzle (Clue Puzzle)
- Operators and Expressions: Space Quest (Flip and Match)
- Variables and Types: Candy Quick Fire (Quick Fire)
- Quiz: First Steps (8 questions)
- Quiz: Input Output Conversion (8 questions)
- Quiz: Operators and Expressions (8 questions)
- Quiz: Variables and Types (8 questions)