-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslang_list.py
56 lines (41 loc) · 1.09 KB
/
slang_list.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
acronyms = []
acronyms.append('LOL')
acronyms.append('IDK')
print(acronyms)
acronyms.append('SMH')
acronyms.append('TBH')
acronyms.append('BFN')
print(acronyms)
acronyms.remove('BFN')
print(acronyms)
del acronyms[3]
print(acronyms)
word = 'BFN'
if word in acronyms:
print(word + ' is in the list')
else:
print(word + ' is NOT in the list')
for acronym in acronyms:
print(acronym)
acronyms = {'LOL': 'laugh out loud',
'IDK': "I don't know",
'TBH': 'to be honest'}
print(acronyms['LOL'])
#create an empty dictionary
acronyms = { }
#adding new dictionary items:
acronyms['LOL']= 'laugh out loud'
acronyms['IDK']= "I don't know"
acronyms['TBH']= 'to be honest'
print(acronyms)
#if you want to get a word in the dictionary, use get()
definition = acronyms.get('BTW')
print(definition)
if definition:
print(definition)
else:
print("key does not exist")
sentence = 'IDK' + ' what happended ' + 'TBH'
translation = acronyms.get('IDK') + ' what happened ' + acronyms.get('TBH')
print('sentence:', sentence)
print('translation:', translation)