Conditional Programs
Python programs focused on decision making using if, elif, else, and nested conditions.
20 program solutions
Program Solutions
Grade Calculator
Calculate letter grade (A, B, C, D, F) from percentage using conditional statements.
Vowel or Consonant
Check whether an alphabetic character is a vowel or a consonant.
Character Classification (Digit / Alpha / Special)
Classify a single character as a digit, alphabet, or special character.
Check Eligibility to Vote
Check if a person is eligible to vote based on age (18 or older).
Check Divisible by 5 and 11
Check whether a given integer is divisible by both 5 and 11.
Check Armstrong Number
Check whether a given integer is an Armstrong (narcissistic) number.
Check Perfect Square
Check whether a number is a perfect square.
Triangle Type Check
Determine if three sides form a valid triangle and its type (equilateral, isosceles, scalene).
Check Strong Number
Check whether a number is a strong number (sum of factorials of digits).
Check Perfect Number
Check whether a number is a perfect number (sum of proper divisors equals the number).
Check Automorphic Number
Check whether a number is automorphic (its square ends with the same digits).
Check Harshad Number
Check whether a number is a Harshad (Niven) number (divisible by sum of its digits).
Check Abundant Number
Check whether a number is abundant (sum of proper divisors is greater than the number).
Check Friendly Pair
Check whether two numbers form a friendly pair (same abundancy index).
Compare Floating Numbers
Compare two floating-point numbers with a tolerance to avoid precision issues.
Menu-Driven Calculator
A simple text-based calculator using a menu and conditional logic.
Bill Discount System
Apply different discount slabs based on total bill amount.
Login Authentication
Simulate a simple login system by comparing username and password with stored values.
Validate Password Strength
Check if a password is strong based on length and character type rules.
Validate Email Format
Validate whether a string matches a basic email address pattern.