Python Operators and Flow of Control - ISC Class 11 Computer Science Notes, Diagrams and Solved Questions

Python's arithmetic, relational, logical, assignment, augmented assignment, identity and membership operators, expressions with precedence and type conversion, the conditional expression, indentation, if-elif-else, for loops with range(), while loops, break and continue, and nested loops for patterns.

In this chapter

  • Using + - * / // % and ** correctly, including with negative numbers
  • Comparing values and joining conditions with and, or and not
  • Augmented assignment, and the identity (is) and membership (in) operators
  • How Python evaluates an expression: precedence, implicit and explicit conversion, and the conditional expression
  • Indentation, and choosing with if, if-else and if-elif-else
  • Repeating with for and range(start, stop, step)
  • Using while loops with break and continue, with a step-by-step dry run
  • Printing tables and patterns with nested loops