- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode1.py
More file actions
Latest commit
36 lines (19 loc) · 503 Bytes
/
Copy pathcode1.py
File metadata and controls
36 lines (19 loc) · 503 Bytes
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
list1= [12,13,34,45,67,890]
list1.sort(reverse=True)
print(list1)
print(list1[0])
#found the largest number in the list in 4 steps
list2= [23,34,44,12,12,456,457]
max=list2[0]
fornumberinlist2:
ifnumber>max:
max=number
print(number)
#method 2 to find the largest number.
number1= [1, 1, 1, 3, 3, 33, 4, 5, 89, 98]
dup= []
foriinnumber1:
ifinotindup:
dup.append(i)
print(dup)
##### removing the duplicates