Skip to main content

06 | Assignment 6

Objective:

The objective of this assignment is to practice using for loops and conditional statements (if, elif, else) in Python.

Instructions:

  1. Write a Python script that performs the following tasks:
  • Create a list of 10 double-digit numbers of your choosing. Be sure to make some of the numbers even, some odd, and some divisible by 5: [15, x2, x5, x4, x7, x5, xx, xx ,xx ,xx].
  • Use a for loop to iterate through each number in the list.
  • For each number, check the following conditions using if, elif, and else statements:
    • If the number is even, print "{number} is even."
    • If the number is divisible by 5, print "{number} is divisible by 5." If the number does not meet any of the above conditions, print {number} doesn't meet the specified conditions

Test your script to ensure it produces the correct output.

Save your Python script with an appropriate filename (e.g., lastname-firstname-assignment6.py).

Submit your Python script file.

Example Output (Expected):

vbnet

1 doesn't meet the specified conditions.
5 is divisible by 5.
10 is even.
15 is divisible by 5.
20 is even.
25 is divisible by 5.

Submission: Submit your Python script file through canvas for assignment 6. Note:

  • Make sure your code follows proper Python syntax and indentation.
  • Ensure that your output matches the general example output provided above.