HW3Q2

 avatar
user_7676782
python
2 years ago
473 B
0
Indexable
Never
lst = []
evenCount = 0
oddCount = 0
#  get from user 10 integers
for i in range(10):
    number = int(input("Enter a number: "))
    lst.append(number)
    # count the number
    # of odd numbers and even numbers
    if number % 2:
        evenCount += 1
    else:
        oddCount += 1
# check
if evenCount<oddCount:
    print("Even")
elif oddCount<evenCount:
    print("odd")
else:
    print("Same")

lst.sort()
print(lst)
lst.reverse()
print(lst)