Back
  • Qissba
  • Courses

      CBSE Class 12

      PYTHON

      Computer Science

      • Python
      • Computer System Overview
      • Computer Networks
      • society Law & Ethics
      • Data Representation
      • Boolean Logics
      Python Online Free Courses for Classes 11th and 12th
  • Blog
  • Shop
    • Cart
    • Checkout
    • My account
  • About Us
  • Contact
  • Career
Have any question?
(+91) 09897990175
qissba@gmail.com
RegisterLogin
Qissba
  • Qissba
  • Courses

      CBSE Class 12

      PYTHON

      Computer Science

      • Python
      • Computer System Overview
      • Computer Networks
      • society Law & Ethics
      • Data Representation
      • Boolean Logics
      Python Online Free Courses for Classes 11th and 12th
  • Blog
  • Shop
    • Cart
    • Checkout
    • My account
  • About Us
  • Contact
  • Career

    Computer Science

    flow -of-execution-in-python

    Flow of Execution in Python | CBSE Class 12

    • Posted by Kabeer Sahib
    • Categories Computer Science

    FLOW OF EXECUTION  IN PYTHON 

    Introduction

    In this tutorial, we shell be learning about the flow of execution in python while execution when we write our program through functions in python program.

    Table of Contents

    Toggle
    • FLOW OF EXECUTION  IN PYTHON 
      • Introduction
      • Program without functions
      • Program with functions
      • IMPORTANT QUESTIONS

     

    step-in-flow-of-execution-in-python

     

    The flow of execution basically refers to the order in which statements are executed. That is to say, execution always starts at the first statement of the program. Moreover, statements execute one at a time. It happens in order, from top to bottom.

    If you are a Python developer or enthusiast, understanding the flow of execution of instructions in Python is crucial for optimizing your code and improving its performance. The flow of execution in Python refers to the order in which statements, functions, and modules are executed in a Python program.

    This flow can greatly impact the performance of your code, and understanding it can help you identify and fix potential issues. In this tutorial, we will explore the flow of execution in Python and discuss how you can optimize your code to improve its performance. So, let’s dive into the world of Python programming and understand the flow of execution in Python!

    A function makes dramatic changes in control flow that also affects execution time, readability and reusability of our python program.

    When a program is executed and the control can take any statement for execution without following the sequence of written program, and completes the required logic behind it, then this random selection of statements execution is called as Functional flow of execution.

    Program without functions

    Generally, in a simple and basic python program, you see that every python program is executed in a sequential manner that means line by line,

    1. the first line executed firstly,
    2. second line executed secondly

    and so on to the last line in a Python program but after creating our programs through functions, the functions completely changed its flow of execution. Now see how.

    Program with functions

    When a python program is written through function, then the control is not going to follow the rule of sequential programming,

    that means, now the program is not going to be executed line by line  (sequentially) and provides the flexibility to execute any statement at any time required to fulfil the logic of the program.

    Now, instead of going to the next statement, and starting from the first, a python program begins with the top level statements according to the logic of program and the flow of control may jumps to the statements required for given logic.

    It may also jumps to body of the function and executes all the statements there, and then comes back to pick up where it left off. See the diagram for flow of execution given blow

     

    For more detailed explanation , you can watch these vedeo classes

     

     

     

    If we write a program in Python to add two numbers in a then the structure of the Python program will be like this

    num1= float(inpit"Entrr first number"))

    num2= float(inpit"Entrr second number"))

    sum=num1+num2

    print (sum)

    And , if we write the same program in Python through function then the structure will be like this.

    def sum( x,y):

         s=x+y

         return sum

    num1= float(inpit"Entrr first number"))

    num2= float(inpit"Entrr second number"))

    sum(num1,num2)

    print (sum)

    Now, compare these steps of execution in both programs.

     

                                   TABLE OF COMPARISION

    S.nowithout functionwith function
    1Line 1Line 4      to          Line 5
    2Line 2Line 6      to          Line 1
    3Line 3Line 2      to          Line 3
    4Line 4Line 6      to          Line 7

     

    That means

    flow-of-ececution-with-function

    Here, you have understood that how the control moves from one line to another following the instruction of program after using functions and this movement/flow of control is known as flow of execution of a program.

     

    Exam Time

    Chapter : Flow of  execution in python


    IMPORTANT QUESTIONS

    Asked in examinations of Class 12th Computer Science

    —————————————————————————————————————————-

    Q1.What are the flow of execution of functions?

    Q2.What are the flow of execution of functions in Python?

    Q3.What is basic flow of execution?

    Q4.What is the function of execute?

    Q5.Does Python run functions in order?

    Q6.What do you understand by flow of execution in python?

    Q7.What is flow of execution in python what does it do with function?

    Q8.What are the steps of execution of Python program?

    Q9.In python, the flow of execution is altered by the use of which statement?

    Q10.What is the basic flow of program execution?

    Q11.Explain the order of execution and style of coding in Python?

     

    ——————————————————————–
    Related Tutorials

         ——————————————————————————————————————– 

    Functions in python CBSE Class 12

    Arguments and parameters in python CBSE Class 12 

    Structure program with functions cbse class12 

    Parameter passing method in python

     

    Also Read in COMPUTER SCIENCE CLASS 12 CBSE

    PYTHON: Data Types  

    How to Learn Python free online 

    Syllabus : computer science with python

    Cloud computing

    Also Read in PHYSICS CLASS 12 CBSE

    Important Concepts Electrostatic Chapter 2 : Electric potential and capacitance

    physics reduced syllabus class 12 cbse 2020-21

    Important notes and questions Class 12 Physics : electric charge and electric field

    Tag:Flow of execution, Flow of execution in python, Python functions

    • Share:
    Kabeer Sahib

    A Trained Post Graduate Teacher with 10 years of experience and working as TGT/PGT–Computer Science including good Management and administration skills with managerial positions in previous work environments

    Previous post

    Functions in python | Tutorial with Examples | CBSE Class 12
    10 June 2021

    Next post

    Parameter Passing methods in Python | 3 Important Method or Techniques | CBSE Class 12
    10 June 2021

    You may also like

    Operator Precedence & Associativity in Python | CBSE Class 11| Computer Science
    24 June 2025

    Dear Class 11th STUDENTS, ! Welcome to this tutorial of Operators in Python from your CBSE class 11 of …

    basics-of-python-programming-languages-cbse-class-11
    Basics of Python Programming Language | CBSE Class 11| Computer Science
    3 June 2025
    encoding-schemes-cbse-class-11-computer-science
    Encoding Schemes | ASCII | ISCII | Unicode | CBSE Class 11| Computer Science
    21 May 2025

    Leave A Reply Cancel reply

    You must be logged in to post a comment.

    Search

    Categories

    • Computer Science
    • Education
    • Education News
    Computer Science : Python – CBSE Class 11

    Computer Science : Python – CBSE Class 11

    ₹1,999.00Free
    Computer Science : System Overview – CBSE Class 11

    Computer Science : System Overview – CBSE Class 11

    ₹999.00Free
    Computer Science : Python – CBSE Class 12

    Computer Science : Python – CBSE Class 12

    ₹1,999.00Free

    Login with your site account

    Lost your password?

    Not a member yet? Register now

    Log in

    Copyright @ 2021 ! QISSBA EDUCATION ! .

    • Privacy
    • Terms
    • Sitemap
    • About Us

    Login with your site account

    Lost your password?

    Not a member yet? Register now

    Register a new account

    Are you a member? Login now