-
Notifications
You must be signed in to change notification settings - Fork 0
/
sysadmin.py
59 lines (42 loc) · 1.38 KB
/
sysadmin.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# lower_limit = int(input("Enter the lower limit: "))
# upper_limit = int(input("Enter lower limit: "))
# number_range = [x for x in range(lower_limit, upper_limit)]
# even_num = []
# odd_num = []
# for num in number_range:
# if num % 2 == 0:
# even_num.append(num)
# else:
# odd_num.append(num)
# print(even_num)
# print(odd_num)
# Lower_limit = int(input("Enter the first number for range: "))
# Upper_limit = int(input("Enter the second number for range: "))
# print("Even numbers are ")
# for value in range(Lower_limit, Upper_limit+1):
# if(value % 2 == 0):
# print(value)
# print("Odd numbers are ")
# for value in range(Lower_limit, Upper_limit+1):
# if(value % 2 == 1):
# print(value)
# low_lim = int(input(" Please enter the lower limit: "))
# up_lim = int(input("Please enter the lower limit: "))
# lower_range = low_lim+1
# output = input("Do you choose an even or odd number (Even/Odd): ")
lower_limit = int(input("Enter the lower limit: "))
upper_limit = int(input("Enter lower limit: "))
lower_range = lower_limit
choice = input("Even number or Odd number (E/O): ")
number_range = [x for x in range(lower_range, upper_limit)]
even_num = []
odd_num = []
for num in number_range:
if num % 2 == 0:
even_num.append(num)
else:
odd_num.append(num)
if choice == "E":
print(even_num)
elif choice == "O":
print(odd_num)