Question 1 If-Else Positive / Negative

Check if a Number is Positive or Negative

Write a Python program using an if-else decision structure to verify whether a given integer is positive or negative.

Solution Code Screenshot Click image to zoom
Positive Negative If-Else Solution
Question 2 If-Else Grading / Pass-Fail

5 Subjects Pass or Fail Evaluation

Write a Python program to read marks for 5 subjects and determine if a student passes or fails based on passing criteria in all subjects.

Solution Code Screenshot Click image to zoom
5 Subjects Pass Fail Solution
Question 3 If-Else Buzz Number

Check Whether a Number is a Buzz Number

Write a Python program using if-else to determine whether a given integer is a Buzz number (divisible by 7 or ending with 7).

Solution Code Screenshot Click image to zoom
Buzz Number If-Else Solution
Question 4 If-Else Digit Extraction

Check 5-Digit Number and Extract Middle Digit

Write a Python program to verify if an input integer contains exactly 5 digits; if true, extract and display its central third digit, otherwise display an invalid length notice.

Solution Code Screenshot Click image to zoom
5 Digit Extract Middle Digit Solution
Question 5 If-Else Geometry

Check if Triangle Can Be Formed from Sides

Write a Python program to input three side lengths and use the triangle inequality theorem in an if-else check to determine if they form a valid triangle.

Solution Code Screenshot Click image to zoom
Check Triangle Can Form Solution
Question 6 If-Else Quadratic Roots

Calculate Roots of a Quadratic Equation

Program to calculate roots of a quadratic equation if the value of x=b2-4ac is less than 0 the roots are imaginary

Solution Code Screenshot Click image to zoom
Roots of Quadratic Equation Solution
Question 7 If-Else Billing

Condition-Based Net Bill Amount Calculation

Write a Python program to calculate purchasing amount find discount,net bill based on given condition if purchase amount >=5000 discount 40% otherwise discount 20%.

Solution Code Screenshot Click image to zoom
Net Bill Calculation Solution
Question 8 If-Else Leap Year

Check if a Given Year is a Leap Year

Write a Python program using if-else to determine whether an input calendar year is a leap year according to gregorian leap year rules.

Solution Code Screenshot Click image to zoom
Leap Year Solution
Question 9 If-Else Pass / Fail

Check Student Pass or Fail Status

Write a Python program to read student percentage or marks and print 'Pass' if the marks meet or exceed the cutoff (e.g. 33%), otherwise print 'Fail'.

Solution Code Screenshot Click image to zoom
Pass Fail Status Solution
Question 10 If-Else Profit / Loss

Calculate Profit or Loss Amount

Write a Python program to input Cost Price (CP) and Selling Price (SP), and use an if-else decision to determine whether a transaction made profit or loss, displaying the exact amount.

Solution Code Screenshot Click image to zoom
Profit Loss Solution
Question 11 If-Else Equality

Check if Three Numbers Are Equal or Not

Write a Python program to input three numbers and verify whether they are equal or different using an if-else statement.

Solution Code Screenshot Click image to zoom
Same Number Solution
Question 12 If-Else Vowel / Consonant

Check if Character is a Vowel or Consonant

Write a Python program to take an alphabet character as input and use if-else to determine whether it is a vowel or a consonant.

Solution Code Screenshot Click image to zoom
Vowel or Consonant Solution
Question 13 If-Else Uniqueness

Check if All Three Numbers Are Unique

Write a Python program to input three numbers and use if-else conditions to verify whether all three values are completely distinct or if duplicates exist.

Solution Code Screenshot Click image to zoom
All Unique Number Solution
Question copied to clipboard!