Flow of Control – NCERT Class 11 Computer Science Chapter 6 – Conditional and Looping Constructs in Python
Explains how Python manages the order of execution of statements using control structures. Covers conditional statements (if, if-else, if-elif), indentation rules, and looping constructs (for and while). Introduces range() function, nested loops, and the use of break and continue statements with various examples. Highlights flowcharts, iteration logic, and pattern generation for better understanding of program control flow.
Updated: 8 months ago

Flow of Control
Chapter 6: Enhanced NCERT Class 11 Guide | Expanded Precise Notes from Full PDF, Detailed Explanations, Diagrams, Examples & Quiz 2025
Enhanced Full Chapter Summary & Precise Notes from NCERT PDF (22 Pages)
Overview & Key Concepts
Exact Definition: "The order of execution of the statements in a program is known as flow of control. The flow of control can be implemented using control structures. Python supports two types of control structures—selection and repetition."
- Introduction: Sequence from Ch 5; Bus analogy (Fig 6.1); Quote: G. van Rossum on indentation.
- Chapter Structure: Selection (if/else/elif), Indentation, Repetition (for/while), Break/Continue, Nested Loops.
- 2025 Relevance: Control in AI loops (e.g., TensorFlow training); Indentation in VS Code; Nested for data processing.
6.1 Introduction to Flow of Control
Precise: Sequential execution; Control structures: Selection/Repetition. Expanded: Program 6-1 (difference); Flow like bus route.
Precise Fig 6.1: Bus to School (SVG)
Program 6-1: Difference of Two Numbers
Output:
Enter first number 5
Enter second number 7
The difference of 5 and 7 is -2
6.2 Selection
Precise: Decision making (if/else/elif); Positive difference (Prog 6-2); Flowchart Fig 6.2. Expanded: Nested if in calculator (Prog 6-3).
Precise Fig 6.2: Decision Flowchart (SVG)
Program 6-2: Positive Difference
Output:
Enter first number: 5
Enter second number: 6
The difference of 5 and 6 is 1
Program 6-3: Simple Calculator
Output:
Enter value 1: 84
Enter value 2: 4
Enter any one of the operator (+,-,*,/): /
The result is 21.0
Example 6.1: if Syntax
Example 6.2: if-elif-else (Positive/Negative/Zero)
Example 6.3: Traffic Signal
6.3 Indentation
Precise: Whitespace for blocks; Strict check; Single tab common. Expanded: Prog 6-4 shows blocks.
Program 6-4: Larger of Two Numbers
Output:
second number is larger
Bye Bye
6.4 Repetition
Precise: Loops for iteration; Butterfly cycle (Fig 6.3); For/While. Expanded: Prog 6-5 (sequence); Range() function.
Precise Fig 6.3: Iterative Process (SVG)
Program 6-5: First Five Natural Numbers
Output:
1
2
3
4
5
Program 6-6: Print 'PYTHON' Characters
Output:
P
Y
T
H
O
N
Program 6-7: Print Sequence [10,20,30,40,50]
Output:
10
20
30
40
50
Program 6-8: Even Numbers
Output:
2 is an even Number
4 is an even Number
6 is an even Number
8 is an even Number
10 is an even Number
Example 6.4: range() Function
Program 6-9: Multiples of 10
Output:
10
20
30
40
Precise Fig 6.4: For Loop Flowchart (SVG)
Program 6-10: First 5 Natural (While)
Output:
1
2
3
4
5
Program 6-11: Factors of Number
Output:
Enter a number to find its factors : 6
1 2 3 6
Precise Fig 6.5: While Loop Flowchart (SVG)
6.5 Break and Continue
Precise: Break: Exit loop; Continue: Skip iteration. Expanded: Prog 6-12 (break at 8); Prog 6-13 (sum positives); Prog 6-14 (prime check).
Precise Fig 6.6: Break Flowchart (SVG)
Program 6-12: Break Demo
Output:
Num has value 1
Num has value 2
Num has value 3
Num has value 4
Num has value 5
Num has value 6
Num has value 7
Encountered break!! Out of loop
Program 6-13: Sum Positives
Output:
Enter numbers to find their sum, negative number ends the loop:
3
4
5
-1
Sum = 12
Program 6-14: Prime Check
Output 1:
Enter the number to be checked: 20
20 is not a prime number
Output 2:
Enter the number to check: 19
19 is a prime number
Precise Fig 6.7: Continue Flowchart (SVG)
Program 6-15: Continue Demo
Output:
Num has value 1
Num has value 2
Num has value 4
Num has value 5
Num has value 6
End of loop
6.6 Nested Loops
Precise: Loop inside loop; No limit on levels. Expanded: Prog 6-16 (nested for); Prog 6-17 (pattern); Prog 6-18 (primes 2-50); Prog 6-19 (factorial).
Program 6-16: Nested For
Output:
Iteration 1 of outer loop
1
2
Out of inner loop
Iteration 2 of outer loop
1
2
Out of inner loop
Iteration 3 of outer loop
1
2
Out of inner loop
Out of outer loop
Program 6-17: Pattern
Output:
Enter a number to generate its pattern = 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Program 6-18: Primes 2-50
Output:
2 is a prime number
3 is a prime number
5 is a prime number
7 is a prime number
11 is a prime number
13 is a prime number
17 is a prime number
19 is a prime number
23 is a prime number
29 is a prime number
31 is a prime number
37 is a prime number
41 is a prime number
43 is a prime number
47 is a prime number
Bye Bye!!
Program 6-19: Factorial
Output:
Enter a number: 5
Factorial of 5 is 120
Enhanced Features (2025)
Full PDF integration, expanded programs (6-1 to 6-19), SVGs (Figs 6.1-6.7), detailed tables/examples, 30 Q&A updated, 10-Q quiz. Focus: Hands-on control flow.
Exam Tips
Write programs (positive diff/prime/pattern); Explain syntax/flowcharts; Differentiate for/while; Use break/continue in code; Nested loop examples.



As an Amazon Associate, ProSyllabus earns from qualifying purchases. Prices shown are subject to change.
Test your CBSE Class 11 Annual Assessment prep
Quizzes
10 questions · ~10 minutes · instant rank & AI diagnosis
Accountancy (Class 11) Practice Quiz | CBSE Class 11 Annual Assessment
Sets and Venn Operations Fundamentals — Free CBSE Class 11 Annual Assessment Quiz
Class 11 English — The Tale of Melon City (Practice Quiz)
Class 11 English — Birth (Practice Quiz)
Class 11 English — Mother's Day (Practice Quiz)
Class 11 English — The Address (Practice Quiz)
Class 11 English — The Summer of the Beautiful White Horse (Practice Quiz)
Class 11 English — Father to Son (Practice Quiz)
Class 11 English — Silk Road (Practice Quiz)
Class 11 English — The Adventure (Practice Quiz)
Class 11 English — Childhood (Practice Quiz)
Class 11 English — The Ailing Planet: the Green Movement's Role (Practice Quiz)
Class 11 English — The Voice of the Rain (Practice Quiz)
Class 11 English — The Laburnum Top (Practice Quiz)
Class 11 English — Discovering Tut: the Saga Continues (Practice Quiz)
Class 11 English — We're Not Afraid to Die... if We Can All Be Together (Practice Quiz)
Class 11 English — A Photograph (Practice Quiz)
Class 11 English — The Portrait of a Lady (Practice Quiz)
Class 11 Psychology — Motivation and Emotion (Practice Quiz)
Class 11 Psychology — Thinking (Practice Quiz)
Class 11 Psychology — Human Memory (Practice Quiz)
Class 11 Psychology — Learning (Practice Quiz)
Class 11 Psychology — Sensory, Attentional and Perceptual Processes (Practice Quiz)
Class 11 Psychology — Human Development (Practice Quiz)
Class 11 Psychology — Methods of Enquiry in Psychology (Practice Quiz)
Class 11 Psychology — What is Psychology? (Practice Quiz)
Class 11 Sociology — Indian Sociologists (Practice Quiz)
Class 11 Sociology — Introducing Western Sociologists (Practice Quiz)
Class 11 Sociology — Environment and Society (Practice Quiz)
Class 11 Sociology — Social Change and Social Order in Rural and Urban Society (Practice Quiz)
Class 11 Sociology — Social Structure, Stratification and Social Processes in Society (Practice Quiz)
Class 11 Sociology — Doing Sociology: Research Methods (Practice Quiz)
Class 11 Sociology — Culture and Socialisation (Practice Quiz)
Class 11 Sociology — Understanding Social Institutions (Practice Quiz)
Class 11 Sociology — Terms, Concepts and Their Use in Sociology (Practice Quiz)
Class 11 Sociology — Sociology and Society (Practice Quiz)
Class 11 Political Science — The Philosophy of the Constitution (Practice Quiz)
Class 11 Political Science — Constitution as a Living Document (Practice Quiz)
Class 11 Political Science — Local Governments (Practice Quiz)
Class 11 Political Science — Federalism (Practice Quiz)
Class 11 Political Science — Judiciary (Practice Quiz)
Class 11 Political Science — Legislature (Practice Quiz)
Class 11 Political Science — Executive (Practice Quiz)
Class 11 Political Science — Election and Representation (Practice Quiz)
Class 11 Political Science — Rights in the Indian Constitution (Practice Quiz)
Class 11 Political Science — Constitution: Why and How? (Practice Quiz)
Class 11 Political Science — Secularism (Practice Quiz)
Class 11 Political Science — Nationalism (Practice Quiz)
Class 11 Political Science — Citizenship (Practice Quiz)
Class 11 Political Science — Rights (Practice Quiz)
Class 11 Political Science — Social Justice (Practice Quiz)
Class 11 Political Science — Equality (Practice Quiz)
Class 11 Political Science — Freedom (Practice Quiz)
Class 11 Political Science — Political Theory: An Introduction (Practice Quiz)
Class 11 Geography — Natural Hazards and Disasters (Practice Quiz)
Class 11 Geography — Natural Vegetation (Practice Quiz)
Class 11 Geography — Climate (Practice Quiz)
Class 11 Geography — Drainage System (Practice Quiz)
Class 11 Geography — Structure and Physiography (Practice Quiz)
Class 11 Geography — India – Location (Practice Quiz)
Class 11 Geography — Biodiversity and Conservation (Practice Quiz)
Class 11 Geography — Movements of Ocean Water (Practice Quiz)
Class 11 Geography — Water (Oceans) (Practice Quiz)
Class 11 Geography — World Climate and Climate Change (Practice Quiz)
Class 11 Geography — Water in the Atmosphere (Practice Quiz)
Class 11 Geography — Atmospheric Circulation and Weather Systems (Practice Quiz)
Class 11 Geography — Solar Radiation, Heat Balance and Temperature (Practice Quiz)
Class 11 Geography — Composition and Structure of Atmosphere (Practice Quiz)
Class 11 Geography — Landforms and their Evolution (Practice Quiz)
Class 11 Geography — Geomorphic Processes (Practice Quiz)
Class 11 Geography — Distribution of Oceans and Continents (Practice Quiz)
Class 11 Geography — Interior of the Earth (Practice Quiz)
Class 11 Geography — The Origin and Evolution of the Earth (Practice Quiz)
Class 11 Geography — Geography as a Discipline (Practice Quiz)
Class 11 History — Paths to Modernisation (Practice Quiz)
Class 11 History — Displacing Indigenous Peoples (Practice Quiz)
Class 11 History — Changing Cultural Traditions (Practice Quiz)
Class 11 History — The Three Orders (Practice Quiz)
Class 11 History — Nomadic Empires (Practice Quiz)
Class 11 History — An Empire Across Three Continents (Practice Quiz)
Class 11 History — Writing and City Life (Practice Quiz)
Class 11 Economics — Comparative Development Experiences of India and its Neighbours (Practice Quiz)
Class 11 Economics — Environment and Sustainable Development (Practice Quiz)
Class 11 Economics — Employment: Growth, Informalisation and Other Issues (Practice Quiz)
Class 11 Economics — Rural Development (Practice Quiz)
Class 11 Economics — Human Capital Formation in India (Practice Quiz)
Class 11 Economics — Liberalisation, Privatisation and Globalisation: An Appraisal (Practice Quiz)
Class 11 Economics — Indian Economy 1950-1990 (Practice Quiz)
Class 11 Economics — Indian Economy on the Eve of Independence (Practice Quiz)
Class 11 Economics — Use of Statistical Tools (Practice Quiz)
Class 11 Economics — Index Numbers (Practice Quiz)
Class 11 Economics — Correlation (Practice Quiz)
Class 11 Economics — Measures of Central Tendency (Practice Quiz)
Class 11 Economics — Presentation of Data (Practice Quiz)
Class 11 Economics — Organisation of Data (Practice Quiz)
Class 11 Economics — Collection of Data (Practice Quiz)
Class 11 Economics — Introduction (Practice Quiz)
Class 11 Business Studies — International Business (Practice Quiz)
Class 11 Business Studies — Internal Trade (Practice Quiz)
Class 11 Business Studies — MSME and Business Entrepreneurship (Practice Quiz)
Class 11 Business Studies — Sources of Business Finance (Practice Quiz)
Class 11 Business Studies — Formation of a Company (Practice Quiz)
Class 11 Business Studies — Social Responsibilities of Business and Business Ethics (Practice Quiz)
Class 11 Business Studies — Emerging Modes of Business (Practice Quiz)
Class 11 Business Studies — Business Services (Practice Quiz)
Class 11 Business Studies — Private, Public and Global Enterprises (Practice Quiz)
Class 11 Business Studies — Forms of Business Organisation (Practice Quiz)
Class 11 Business Studies — Business, Trade and Commerce (Practice Quiz)
Class 11 Accountancy — Financial Statements - II (Practice Quiz)
Class 11 Accountancy — Financial Statements - I (Practice Quiz)
Class 11 Accountancy — Depreciation, Provisions and Reserves (Practice Quiz)
Class 11 Accountancy — Trial Balance and Rectification of Errors (Practice Quiz)
Class 11 Accountancy — Bank Reconciliation Statement (Practice Quiz)
Class 11 Accountancy — Recording of Transactions - II (Practice Quiz)
Class 11 Accountancy — Recording of Transactions - I (Practice Quiz)
Class 11 Accountancy — Theory Base of Accounting (Practice Quiz)
Class 11 Accountancy — Introduction to Accounting (Practice Quiz)
Class 11 Maths — Probability (Practice Quiz)
Class 11 Maths — Statistics (Practice Quiz)
Class 11 Maths — Limits and Derivatives (Practice Quiz)
Class 11 Maths — Introduction to Three Dimensional Geometry (Practice Quiz)
Class 11 Maths — Conic Sections (Practice Quiz)
Class 11 Maths — Straight Lines (Practice Quiz)
Class 11 Maths — Sequences and Series (Practice Quiz)
Class 11 Maths — Binomial Theorem (Practice Quiz)
Class 11 Maths — Permutations and Combinations (Practice Quiz)
Class 11 Maths — Linear Inequalities (Practice Quiz)
Class 11 Maths — Complex Numbers and Quadratic Equations (Practice Quiz)
Class 11 Maths — Relations and Functions (Practice Quiz)
Class 11 Maths — Sets (Practice Quiz)
Class 11 Biology — Chemical Coordination and Integration (Practice Quiz)
Class 11 Biology — Neural Control and Coordination (Practice Quiz)
Class 11 Biology — Locomotion and Movement (Practice Quiz)
Class 11 Biology — Excretory Products and their Elimination (Practice Quiz)
Class 11 Biology — Body Fluids and Circulation (Practice Quiz)
Class 11 Biology — Breathing and Exchange of Gases (Practice Quiz)
Class 11 Biology — Plant Growth and Development (Practice Quiz)
Class 11 Biology — Respiration in Plants (Practice Quiz)
Class 11 Biology — Photosynthesis in Higher Plants (Practice Quiz)
Class 11 Biology — Cell Cycle and Cell Division (Practice Quiz)
Class 11 Biology — Biomolecules (Practice Quiz)
Class 11 Biology — Cell: The Unit of Life (Practice Quiz)
Class 11 Biology — Structural Organisation in Animals (Practice Quiz)
Class 11 Biology — Anatomy of Flowering Plants (Practice Quiz)
Class 11 Biology — Morphology of Flowering Plants (Practice Quiz)
Class 11 Biology — Animal Kingdom (Practice Quiz)
Class 11 Biology — Plant Kingdom (Practice Quiz)
Class 11 Biology — Biological Classification (Practice Quiz)
Class 11 Biology — The Living World (Practice Quiz)
Class 11 Chemistry — Hydrocarbons (Practice Quiz)
Class 11 Chemistry — Organic Chemistry – Some Basic Principles and Techniques (Practice Quiz)
Class 11 Chemistry — Redox Reactions (Practice Quiz)
Class 11 Chemistry — Equilibrium (Practice Quiz)
Class 11 Chemistry — Chemical Bonding and Molecular Structure (Practice Quiz)
Class 11 Chemistry — Classification of Elements and Periodicity in Properties (Practice Quiz)
Class 11 Chemistry — Some Basic Concepts of Chemistry (Practice Quiz)
Class 11 Physics — Waves (Practice Quiz)
Class 11 Physics — Oscillations (Practice Quiz)
Class 11 Physics — Kinetic Theory (Practice Quiz)
Class 11 Chemistry — Thermodynamics (Practice Quiz)
Class 11 Physics — Thermal Properties of Matter (Practice Quiz)
Class 11 Physics — Mechanical Properties of Fluids (Practice Quiz)
Class 11 Physics — Mechanical Properties of Solids (Practice Quiz)
Class 11 Physics — Gravitation (Practice Quiz)
Class 11 Physics — Systems of Particles and Rotational Motion (Practice Quiz)
Class 11 Physics — Work, Energy and Power (Practice Quiz)
Class 11 Physics — Motion in a Plane (Practice Quiz)
Class 11 Physics — Motion in a Straight Line (Practice Quiz)
Class 11 Physics — Units and Measurement (Practice Quiz)
Class 11 Maths — Trigonometric Functions (Practice Quiz)
Class 11 Chemistry — Structure of Atom (Practice Quiz)
Class 11 Physics — Laws of Motion (Practice Quiz)
Business Studies (Class 11) Practice Quiz | CBSE Class 11 Annual Assessment
Economics (Class 11) Practice Quiz | CBSE Class 11 Annual Assessment
Humanities Subjects Practice Quiz | CBSE Class 11 Annual Assessment
Motion in a Straight Line Practice Quiz | CBSE Class 11 Annual Assessment
Thermodynamic Processes and Laws Advanced Challenge | CBSE Class 11 Annual Assessment

Group Discussions
No forum posts available.


