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

    If else statement python CBSE class 12

    • Posted by Kabeer Sahib
    • Categories Computer Science

    If else statement

    This form of if else statement tests a condition and if the condition evaluates to true than it carries out statements below if otherwise if the condition evaluates to false, it carries out the statements intended below else the syntax of if-else statement is shown below.

    Table of Contents

    Toggle
    • If else statement
      • Why If else statements in Python
      • Exam Time
      • IMPORTANT QUESTIONS : Asked in examinations of Class 12th Computer Science
        • Important questions

              If <conditional expression>:

                    Statement

                    Statement

              else:

                    Statement

                    Statement

    For example, consider the following code snippet.

             If a>=0:

                   Print (a, “is a positive number”)

             else:

                     Print (a, “is a negative number”)

     

    Have you seen the above code, having any value more than 0 of variable the above code will print a message like (let’s say 2)

                                                       2 is positive number

    for value less than zero (let’s see -5) the above code will print a message like?

                                                      -5 is a negative number

    After learning the above discussion, we have understood that unlike to simple if statement, which does nothing when the condition results false, the if else statement perform some action is true or false.

    Now let’s have an another example 

    If sales >=10,000:

            commission = sales*0.10

    else:

            commission = sales*0.05

     

    A flow chart for if else statement will help you in better understanding the above discussion

    Let’s have a look

    Fig: – THE ITERATON CONSTRUCT

     

    The selection construct

     Fig: – THE SELECTION CONSTRUCT

    So far , you have understand about if else statement in python, I think you can observe the following program code in python.

    Here we are writing a python code/program to accept three integers and print the largest of three by making use of only If statement.

    Here, we have Please observe the python code.

    The If-Else statement code

    and here it a flow chart for the same code.

    The If-Else statement flow chart

     

    Why If else statements in Python

    In this tutorial, We have learnt about if  else ststement in python for CBSE class 11 & 12 and its related concepts according to CBSE syllabus. This tutorial is useful for Central Board of secondary education (CBSE) student of class 11th & 12th, who opted computer science (Code 083) as an optional subject. This topic is also important to start learning python programing language for beginners of class 11th and 12th.

    You can check the latest CBSE syllabus for computer science Click here for syllabus OR Click here

    UNIT NO.UNIT NAMEMARKS
    1Computational thinking and programming 40
    2Computer network 10
    3Database management 20
    4Practical30
    5Total100

     

    Unit II: Computational Thinking and Programming – 1

    According to the syllabus, Unit  II  Computational Thinking and Programming – 1 has  the above concepts for learning related to If-Else Statements in Python.

     

     

    Exam Time

    Chapter : Using Python Libraries

    IMPORTANT QUESTIONS : Asked in examinations of Class 12th Computer Science

    Important questions

    Tag:CBSE, classs 11, Conditional and Iterative statements, free python tutorial, Mohammad Amees, python notes, qissba, qissba technology, The If-Else statement

    • 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

    If Statement Python - CBSE Class 12
    20 October 2022

    Next post

    Variables and Assignments in Python | CBSE Class 12
    11 November 2022

    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