-
Notifications
You must be signed in to change notification settings - Fork 0
/
myLoop.py
53 lines (43 loc) · 1.03 KB
/
myLoop.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
# nCtr = 5
# while(nCtr > 0):
# print(nCtr, 'NIIT - learning never stops!')
# nCtr -= 1
# print('*******************')
# nCtr = 1
# while(nCtr <= 5):
# print(nCtr, 'NIIT - learning never stops!')
# nCtr += 1
# n = 2
# while (n <= 10):
# if(n % 2 == 0):
# print(n, end = ' ')
# n += 1
# while True:
# line = input('Enter something >>> ')
# if(line == 'done'):
# break
# print(line)
# print("Done!!!")
# while True:
# line = input('Enter something >>> ')
# if(line[0] == '#'):
# continue
# if(line == 'done'):
# break
# print(line)
# print("Done!!!")
Total = 0
iMax = 0
iMin = 0
myValList = [45, 34, 10, 67, 105, 78, 99]
for sum in myValList:
Total += sum
print('The sum of the values in list is: ', Total)
for sum in myValList:
if(iMin == 0 or iMin > sum):
iMin = sum
print('The min of the values in list is: ', iMin)
for sum in myValList:
if(iMax == 0 or iMax < sum):
iMax = sum
print('The max of the values in list is: ', iMax)