-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTutorial6.py
More file actions
93 lines (78 loc) · 1.84 KB
/
Copy pathTutorial6.py
File metadata and controls
93 lines (78 loc) · 1.84 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#Tutorial 6
#Question1
#count = 0
#my_List = []
#while count < 5:
#num = float(input("Enter a number:"))
#my_List.append(num)
#count +=1
#sorted arranges the value in ascending order
#print(sorted(my_List))
#Question2
#count = 0
#Total = 0
#my_List = []
#while count < 5:
#num = float(input("Enter a number:"))
#Total += num
#my_List.append(num)
#count +=1
#sorted arranges the value in ascending order
#print(sorted(my_List))
#print(f"Total = {Total}")
#Average = (Total / count)
#print(f"Average = {Average}")
#Question3
#count = 0
#forward_list = []
#while count < 5:
#num = float(input("Enter a number:"))
#forward_list.append(num)
#count +=1
#print in ascending order
#print(f"forward_list = {sorted(forward_list)}")
#To print in descending order, make sure reverse = True
#print(f"reverse_list = {sorted(forward_list, reverse = True)}")
#Question4
#count = 0
#my_List = []
#while count < 5:
#num = float(input("Enter a number:"))
#my_List.append(num)
#count +=1
#print(f"my_List = {sorted(my_List)}")
#for _ in range(5):
#print(sorted(my_List))
#my_List.pop()
#print("[]")
#for _ in range(5):
#print(sorted(my_List))
#del my_List[-1]
#print("[]")
#Question 5
#count = 0
#my_List = []
#while count < 5:
#num = input("Enter a data:")
#my_List.append(num)
#count +=1
#print(f"my_List = {sorted(my_List)}")
#for _ in range(5):
#print(my_List)
#my_List.pop()
#print("[]")
#Question 6
count = 0
my_List = []
while count < 5:
num = input("Enter a number:")
my_List.append(num)
count +=1
#print(f"my_List = {sorted(my_List)}")
print(my_List)
while count >= 0:
if count % 2 == 0:
del my_List[count]
print(my_List)
count -=1
#print("[]")