Labelling numbers in python assignment expert

LABELLING NUMBERS

0 EVEN

1 ODD

2 EVEN

3 ODD

def label_numbers[L]:
    print["Labelling numbers"]
    for x in L:
        if x % 2 == 0:
            print[x, "EVEN"]
        else:
            print[x, "ODD"]

def main[]:
    L = [0, 1, 2, 3]
    label_numbers[L]

main[]

Learn more about our help with Assignments: Python

 Harry  September 1, 2022

Problem Statement:

In First and Last Digits in Python, we are given two positive numbers, we need to find the count of those numbers which have the same first and last digit. Also, if the number is below 10 it will also be counted. For example, 1, 2, 3, 4, … ,9. will be counted.

Code for First and Last Digits in Python:

n1 = 5
n2 = 203
count = 0
for i in range[n1, n2 + 1]:
    if i

Chủ Đề