Phase 1 - Level 3: Math and Number Logic
Solve mathematical and number logic problems using conditionals.
10 programs · open one, then the next
Start with Check if All Digits are Distinct- 01Check if All Digits are DistinctIntermediateExtract the hundreds, tens, and units of a three-digit integer. Students use Python division and remainder to check every pair of digits for a repeated value.Open example →py# Take 3-digit number num = int(input("Enter a 3-digit number: ")) # Extract digits
- 02Check Middle DigitIntermediateCompare the middle digit with both outside digits of a three-digit number. This Python exercise teaches strict comparisons and how ties affect a classification.Open example →py# Take 3-digit number num = int(input("Enter a 3-digit number: ")) # Extract digits
- 03Check First and Last Digits EqualIntermediateRead the first and last digits of a four-digit integer with Python. Beginners compare place values using floor division, remainder, and one equality condition.Open example →py# Take 4-digit number num = int(input("Enter a 4-digit number: ")) # Extract first and last digits
- 04Check Digit Count TypeIntermediateClassify an integer as single-digit, double-digit, or multi-digit. Students follow Python abs, ordered size thresholds, and how zero and negative inputs behave.Open example →py# Take number num = abs(int(input("Enter a number: "))) # Check digit count
- 05Multiple of 7 or Ends with 7IntermediateCombine two number rules: divisibility by seven or a last digit of seven. A Python beginner lesson on named boolean values and inclusive or conditions.Open example →py# Take number num = int(input("Enter a number: ")) # Check conditions
- 06Determine QuadrantIntermediateLocate a point in a quadrant, on an axis, or at the origin. Students trace Python sign comparisons and see why zero coordinates need separate branches.Open example →py# Take coordinates x = float(input("Enter x coordinate: ")) y = float(input("Enter y coordinate: "))
- 07Currency Division CheckIntermediateCheck whether an amount divides evenly by three stated denominations. Students practice Python and conditions and distinguish this test from making change.Open example →py# Take amount amount = int(input("Enter amount: ")) # Check if divisible by all denominations
- 08Check if Number in RangeIntermediateTest whether a whole number lies between one hundred and nine hundred ninety-nine. A Python lesson on inclusive chained comparisons and boundary testing.Open example →py# Take number num = int(input("Enter a number: ")) # Check range
- 09Calculate Third AngleIntermediateCalculate a triangle's third angle and reject nonpositive angles. Students follow float input, subtraction, and three conditions needed for a valid result.Open example →py# Take two angles angle1 = float(input("Enter first angle: ")) angle2 = float(input("Enter second angle: "))
- 10Check Perfect SquareIntermediateSearch for an integer whose square equals the input. A beginner Python loop exercise on flags, early stopping, and why zero needs inclusion in the search.Open example →py# Take number num = int(input("Enter a number: ")) # Check if perfect square