Phase 6 - Category 5: Real-World Logic Problems
Solve real-world inspired logic problems.
15 programs · open one, then the next
Start with Password Strength Checker- 01Password Strength CheckerAdvancedScore a practice password against five checks. Students combine len and any, add boolean results, and recognize why a classroom score is not a security guarantee.Open example →py# Take password password = input("Enter password: ") # Check criteria
- 02Advanced Grade CalculatorAdvancedCalculate a weighted grade average in Python. Students multiply marks by weights, divide by total weight, and apply descending grade cutoffs to the actual mean.Open example →py# Take number of subjects n = int(input("Enter number of subjects: ")) # Take marks and weights
- 03BMI Calculator with CategoryIntermediateCompute BMI from kilograms and meters with Python. Students square height, apply adult cutoffs, and understand why a screening example is not a diagnosis.Open example →py# Take inputs weight = float(input("Enter weight (kg): ")) height = float(input("Enter height (m): "))
- 04Simple Interest CalculatorBeginnerCalculate simple interest and amount with floats. Students convert an annual percent rate, keep interest separate from principal, and format monetary examples.Open example →py# Take inputs principal = float(input("Enter principal: ")) rate = float(input("Enter rate (%): ")) time = float(input("Enter time (years): "))
- 05Compound Interest CalculatorIntermediateCalculate compound interest with a chosen frequency. Students distinguish a per-period rate from an annual rate and multiply years by periods per year.Open example →py# Take inputs principal = float(input("Enter principal: ")) rate = float(input("Enter rate (%): ")) time = float(input("Enter time (years): "))
- 06Temperature ConverterIntermediateConvert among Celsius, Fahrenheit, and Kelvin with branches. Students normalize the unit label, calculate via Celsius, and format all three output temperatures.Open example →py# Take input temp = float(input("Enter temperature: ")) unit = input("Enter unit (C/F/K): ").upper()
- 07Simple Currency ConverterIntermediateConvert currencies through fixed example USD-relative rates. Students divide into a common base and multiply out without treating sample rates as live prices.Open example →py# Exchange rates (example) rates = { 'USD': 1.0, 'EUR': 0.85,
- 08Age Calculator from Birth DateIntermediateCalculate completed years from a full birth date with Python. Students compare month-day pairs to adjust for birthdays instead of subtracting birth years alone.Open example →pyfrom datetime import date # Take birth date year = int(input("Enter birth year: "))
- 09Discount CalculatorBeginnerCalculate a discount and payable price with Python. Students convert a percentage, subtract its monetary value, and display original, saved, and final amounts.Open example →py# Take inputs price = float(input("Enter price: ")) discount_percent = float(input("Enter discount (%): "))
- 10Tip CalculatorBeginnerAdd a percentage tip and split the total with Python. Students keep the tip, combined bill, and per-person amount distinct and check the divisor's valid domain.Open example →py# Take inputs bill = float(input("Enter bill amount: ")) tip_percent = float(input("Enter tip percentage: ")) people = int(input("Enter number of people: "))
- 11Simple CalculatorBeginnerBuild a four-operation Python calculator. Students compare operator text, perform float arithmetic, and handle zero divisors or unsupported operator choices.Open example →py# Take inputs num1 = float(input("Enter first number: ")) operator = input("Enter operator (+, -, *, /): ") num2 = float(input("Enter second number: "))
- 12Grade SystemBeginnerAssign a letter grade from a percentage. Students separate reading a percentage from averaging marks and trace the same descending cutoff policy at boundaries.Open example →py# Take percentage percentage = float(input("Enter percentage: ")) # Determine grade
- 13Password ValidatorBeginnerValidate practice passwords with character rules. Students compare a strong-rule conjunction with a looser medium branch and inspect allowed special symbols.Open example →py# Take password password = input("Enter password: ") # Validate
- 14Age Calculator from Birth YearBeginnerEstimate age from a birth year and classify its band with Python. Students use the current calendar year and see why this is not a birthday-aware age calculator.Open example →py# Take inputs from datetime import datetime birth_year = int(input("Enter birth year: ")) current_year = datetime.now().year
- 15Unit ConverterBeginnerConvert selected length, mass, and temperature unit pairs. Students choose a valid branch and distinguish scale-only conversions from temperature offsets.Open example →py# Take inputs value = float(input("Enter value: ")) from_unit = input("From unit (km/m, kg/g, C/F): ") to_unit = input("To unit (km/m, kg/g, C/F): ")