Phase 1 - Level 4: Logical Operators & Compound Statements
Master logical operators and compound conditional statements.
10 programs · open one, then the next
Start with Check Letter, Digit, or Neither- 01Check Letter, Digit, or NeitherIntermediateClassify entered text as letters, digits, or neither with Python. Students compare string tests and discover why a character prompt does not enforce length.Open example →py# Take character ch = input("Enter a character: ") # Check type
- 02FizzBuzz ProblemIntermediateSolve single-number FizzBuzz using ordered Python conditions. Beginners trace shared multiples, individual rules, and why the combined case must come first.Open example →py# Take number num = int(input("Enter a number: ")) # FizzBuzz logic
- 03Find Median ValueIntermediateFind the median of three values without sorting a list. A Python exercise on two possible orderings, compound conditions, and handling equal middle values.Open example →py# Take three numbers a = float(input("Enter first number: ")) b = float(input("Enter second number: ")) c = float(input("Enter third number: "))
- 04AM or PM CheckIntermediateDetermine AM or PM from a twenty-four-hour time in Python. Students inspect the noon boundary and notice that the entered minutes do not affect this label.Open example →py# Take time hours = int(input("Enter hours (0-23): ")) minutes = int(input("Enter minutes (0-59): "))
- 05Tax Eligibility CheckIntermediatePractice a two-condition income and age check in Python. Students trace strict thresholds and understand why this classroom rule is not real tax guidance.Open example →py# Take income and age income = float(input("Enter income (in lakhs): ")) age = int(input("Enter age: "))
- 06Positive Numbers Sum CheckIntermediateCheck that two numbers are positive and their sum is below one hundred. A Python exercise on three linked tests, strict boundaries, and failed conditions.Open example →py# Take two numbers num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: "))
- 07Print Digit WordIntermediateConvert one digit to its English word with a Python list. Beginners practice zero-based indexing and validate a number before using it as a list position.Open example →py# Take digit digit = int(input("Enter a digit (0-9): ")) # Map to word
- 08Weekday or WeekendIntermediateSeparate weekdays from weekends using a numbered week in Python. Students combine a chained range check, an or condition, and a final invalid-value branch.Open example →py# Take day number day = int(input("Enter day number (1-7): ")) # Check weekday or weekend
- 09Electricity Bill CalculationIntermediateCalculate a bill with increasing unit-price slabs in Python. Students trace cumulative charges, subtract already billed units, and test exact slab boundaries.Open example →py# Take units units = float(input("Enter units consumed: ")) # Calculate bill based on slabs
- 10Basic Password ValidationIntermediateValidate a practice password with length and digit rules in Python. Students use len, any, and independent feedback checks without confusing this with security.Open example →py# Take password password = input("Enter password: ") # Check rules