Help with the code to display numbers in twos, fours from a list of numbers

I need help on how to write the following codes:

  1. list of numbers 1 - 50
  2. display numbers in 2’s or 4’s from this list.
  3. the result of step 2 is to be displayed as TEXT instead of NUMBERS.
    for e.g. all numbers that are multiples of 2: 2,4,6,8,10 etc. should be as displayed FOOT, but not as 2,4,6,8,10 as the case maybe.
  1. What is your code that you have tried so far?
  2. You will have to do a loop. Do you know how to do that in Python?

An even number is a number divisible by 2 and has no remainder. The operator % is called “modulus”. The code for this is:

if (num % 2) == 0: 
    print("This is an even number")

A number divisible by 4 with no remainder is similar.

if (num % 4) == 0: 
    print("This number is evenly divisible by 4")

Links

  1. Here is more info on the modulus operator. Python Modulo in Practice: How to Use the % Operator – Real Python The modulus % is for integers only.
  2. This is a better site as well. The Python Modulo Operator - What Does the % Symbol Mean in Python? (Solved)