-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1_1.py
More file actions
48 lines (37 loc) · 957 Bytes
/
task1_1.py
File metadata and controls
48 lines (37 loc) · 957 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
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""task1_1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/18SRLQC7wf9SbGFX-EMUexQQgTcCUIs7I
"""
modern_family = ['CLaiRe_DunPhY', 'PHiL_dUnpHY', 'GLoRiA_PriTCheTt', 'CaMErOn_TuCKEr','StELLa']
indices=[]
characters=[]
for i,j in enumerate(modern_family):
indices.append(i)
characters.append(j)
print(indices)
print(characters)
lowercase=[]
replaced=[]
for i in characters:
lowercase.append(i.lower())
print(lowercase)
for i in lowercase:
replaced.append(i.replace('_','-'))
print(replaced)
length = lambda seq:len(seq)
temp=[]
temp = list(map(length, characters))
print(temp)
indices = list(map(sum,zip(indices,temp)))
print(indices)
indices.sort(reverse=True)
print(indices)
Phew_finally = {}
for key in indices:
for value in characters:
Phew_finally[key] = value
characters.remove(value)
break
print(Phew_finally)