EXERCISES

Site: Learning Management System
Course: Edo College ICT Club Programme
Book: EXERCISES
Printed by: Guest user
Date: Saturday, 3 January 2026, 7:46 AM

Description

beginner-friendly exercises based on the topics you’ve covered.

1. 1. Variables & Basic Output

Create three variables:

  • name → your name

  • age → your age

  • school → the name of your school

Print them in one sentence like:
My name is ___, I am ___ years old, and I attend ___.


2. 2. String Formatting

Ask the user for their first name and last name using input().
Then print out:
Hello <firstname> <lastname>, welcome to Python class!

3. 3. Arithmetic Operators

Write a program that takes two numbers from the user and prints:

  • their sum

  • their difference

  • their product

  • their quotient


4. 4. Comparison Operators

Create two variables:

x = 25 y = 40

Write code to check and print:

  • if x is greater than y

  • if x is equal to y

  • if y is greater than x


5. 5. Logical Operators

Write a program that checks whether a number entered by the user is between 10 and 50 (inclusive).
Use:

  • >=, <=

  • and


6. 6. Conditional Statements

Ask the user for their score (0–100).
Then print:

  • "Excellent" if score ≥ 70

  • "Good" if score ≥ 50 and < 70

  • "Fail" if score < 50


7. 7. Loops — For Loop

Print all even numbers from 1 to 20 using a for loop.

8. 8. Loops — While Loop

Ask the user for a number.
Use a while loop to count down from that number to 1.
Print each number.