Question 1 For Loop Basics

Extract and Display ASCII / Unicode Code Points of a String

Write a Python program to iterate over a given string ("python"). For each character in the string, retrieve its ASCII/Unicode numerical code using the ord() function, and print the character alongside its corresponding code point separated by a hyphen (-).

Solution Code Screenshot Click image to zoom
For Loop Solution
Question 2 For Loop Multiples

Compute Sum of All 3-Digit Odd Multiples of 5

Write a Python program to calculate the total sum of all 3-digit odd multiples of 5 using a for loop with a step value in range().

Solution Code Screenshot Click image to zoom
3 Odd Multiple of 5 Solution
Question 3 For Loop Prime Check

Verify Whether an Integer is a Prime Number

Write a Python program to read an integer from the user. Using a for loop and a counter variable, determine how many factors divide the number evenly.

Solution Code Screenshot Click image to zoom
Check Prime Number Solution
Question 4 For Loop Factors Count

Count Total Factors of an Integer

Write a Python program to accept a positive integer from the user. Using a for loop and the modulus operator (%), iterate through all possible divisors from $1$ up to the number itself. Count how many numbers divide the input evenly and print the total factor count.

Solution Code Screenshot Click image to zoom
Count Number of Factors Solution
Question 5 For Loop Extremes

Find the Largest and Smallest Integers Among 10 User Inputs

Write a Python program to read 10 integers sequentially from the user. Without using lists or built-in functions like max() and min(), determine both the largest and smallest numbers entered using a single for loop and conditional statements.

Solution Code Screenshot Click image to zoom
Display Large Small Int Solution
Question 6 For Loop Maximum Value

Find the Maximum Integer Among 10 User Inputs

Write a Python program that prompts the user to enter 10 integers sequentially. Using a for loop and conditional updating (without using lists or the built-in max() function), find and display the largest number entered.

Solution Code Screenshot Click image to zoom
Display Largest Int Solution
Question 7 For Loop Factorial

Factorial Computation with Input Validation for Non-Negative Integers

Write a Python program to calculate the factorial (n!) of an input number using a for loop with the range() function.

Solution Code Screenshot Click image to zoom
Find Factorial of Num Solution
Question 8 For Loop Even Maximum

Find the Largest Even Number in a Sequence

Write a Python program using a for loop to scan through input values and determine the highest even integer among them.

Solution Code Screenshot Click image to zoom
Find Large Even Solution
Question 9 For Loop Print Factors

Find and Print All Factors of a Number

Write a Python program to read an integer and print all of its divisors/factors using a for loop.

Solution Code Screenshot Click image to zoom
Print Factors of Num Solution
Question 10 For Loop range() Function

Demonstration of range(start, stop, step) Patterns

Write a Python program illustrating the use of the range() function with one, two, and three arguments, including negative step strides.

Solution Code Screenshot Click image to zoom
For Loop Range Solution
Question 11 For Loop Fibonacci Sum

Calculate Sum of First 10 Fibonacci Numbers

Write a Python program using a for loop to compute both the first 10 terms of the Fibonacci sequence and their total sum.

Solution Code Screenshot Click image to zoom
Sum of 1st 10 Fibonacci Solution
Question 12 For Loop Conditional Accumulator

Sum 2-Digit and 3-Digit Numbers from Input

Write a Python program using a for loop to accept multiple numbers and calculate separate sums for 2-digit numbers and 3-digit numbers.

Solution Code Screenshot Click image to zoom
Sum of 2 and 3 Digit Numbers Solution
Question 13 For Loop Accumulator

Calculate Sum of 10 Integers

Write a Python program to read 10 integers from the user using a for loop and calculate their sum.

Solution Code Screenshot Click image to zoom
Sum of 10 Integers Solution
Question 14 For Loop Even Numbers

Sum All 3-Digit Even Natural Numbers (100 to 998)

Write a Python program using a for loop to compute the sum of all 3-digit even natural numbers (from 100 to 998).

Solution Code Screenshot Click image to zoom
Sum of 3 Digit Even Natural Numbers Solution
Question 15 For Loop Even Filter Sum

Sum Only the Even Numbers Among 10 User Integers

Write a Python program to take 10 integers from the user in a for loop and calculate the sum of only those numbers that are even.

Solution Code Screenshot Click image to zoom
Sum of Even Among 10 Integers Solution
Question copied to clipboard!