Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsPython

Conditional Programs

if / elif / else. Grades, vowels, triangle types. The bugs usually hide in the equal-to case.

20 programs · open one, then the next

The matching chapter is Day 8: Conditional Statements in the Python course. For a short check, try the Python quiz (300 questions). Every topic is listed on Python exercises.

Start with Grade Calculator
  1. 01Grade CalculatorBeginnerCheck marks before assigning a letter grade in Python. A first conditional ladder shows why high cutoffs come first and why 107% must not receive an A.Open example →
  2. 02Vowel or ConsonantBeginnerNormalize A to a before testing Python vowel membership. A beginner character exercise combines validation with an honest look at its English-only vowel rule.Open example →
  3. 03Character Classification (Digit / Alpha / Special)BeginnerIs @ a letter, digit, or something else? Classify one Python character, validate its length, and learn the Unicode limits of this beginner branching exercise.Open example →
  4. 04Check Eligibility to VoteBeginnerInclude age 18 and reject negative ages in a Python threshold exercise. New programmers separate invalid input from a failed eligibility rule at the boundary.Open example →
  5. 05Check Divisible by 5 and 11BeginnerBoth is not the same as either: test Python remainders for 5 and 11 together. Beginner examples use 55, zero, and a number that satisfies only one condition.Open example →
  6. 06Check Armstrong NumberBeginnerProve that 153 equals its powered-digit sum with Python. A beginner walkthrough derives the exponent from digit count and safely handles negative responses.Open example →
  7. 07Check Perfect SquareBeginnerUse an exact Python integer square root to test perfect squares. Beginners compare the squared candidate with the input without introducing float rounding.Open example →
  8. 08Triangle Type CheckBeginnerValidate three Python side lengths before naming the triangle. First-year logic practice covers strict inequalities, equal sides, and the flat 1-2-3 case.Open example →
  9. 09Check Strong NumberBeginnerExplain 145 through 1! + 4! + 5! in a Python digit loop. New programmers practice extraction, a running sum, and why the single zero digit contributes one.Open example →
  10. 10Check Perfect NumberBeginnerAdd the proper divisors of 6 and recover 6 with Python. A beginner number-property lesson excludes the input itself and tests the often-missed value one.Open example →
  11. 11Check Automorphic NumberBeginnerDoes 25 appear at the end of its square? Answer with Python multiplication and endswith in a beginner exercise that separates numeric value from digit text.Open example →
  12. 12Check Harshad NumberBeginnerDivide 18 by its digit sum to check a Python Harshad number. Beginner steps explain generators, positive-input rules, and short-circuit protection from zero.Open example →
  13. 13Check Abundant NumberBeginner12 has proper divisors totaling 16. Follow this Python beginner search to understand abundant numbers and why an equal divisor sum belongs to another category.Open example →
  14. 14Check Friendly PairIntermediateCompare 6 and 28 through their divisor-sum ratios in Python. An introductory helper-function exercise explains friendly numbers and the limits of float equality.Open example →
  15. 15Compare Floating NumbersIntermediateChoose what close means before comparing Python floats. A beginner math.isclose example uses an absolute tolerance and separates approximate equality from order.Open example →
  16. 16Menu-Driven CalculatorBeginnerRoute a Python menu choice to addition, subtraction, multiplication, or division. New programmers trace text choices, numeric operands, and a zero-divisor guard.Open example →
  17. 17Bill Discount SystemBeginnerTake one discount percentage off a Python bill. A beginner threshold exercise contrasts this policy with slabs and keeps negative amounts out of payment math.Open example →
  18. 18Login AuthenticationBeginnerRequire both demo credentials to match in a Python login decision. Beginners practice and and string equality without mistaking hardcoded text for real security.Open example →
  19. 19Validate Password StrengthIntermediateCheck length and character groups with Python regex searches. This beginner password-policy exercise explains matches and why passing is not proof of safety.Open example →
  20. 20Validate Email FormatIntermediateTest an email-shaped string with Python regex and if. For new programmers, this example separates a rough formatting rule from a mailbox that actually exists.Open example →