-
Notifications
You must be signed in to change notification settings - Fork 6
/
Finger_2.4.py
35 lines (25 loc) · 880 Bytes
/
Finger_2.4.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 9 15:35:16 2019
@author: astoned
"""
# =============================================================================
# Finger exercise: Write a program that asks the user to input 10 integers, and
# then prints the largest odd number that was entered. If no odd number was
# entered, it should print a message to that effect.
# =============================================================================
list = []
odds = False
print('You will be asked to enter 10 integer numbers, one at a time.')
for i in range(1,11):
i = int(input('Number: '))
list.append(i)
list = sorted(list, reverse = True)
for j in list:
if j%2 == 1:
print('The largest odd number is', j, 'from', list)
odds = True
break
if odds == False:
print('There is no odd number from', list)