Skip to content

Commit 184f815

Browse files
committed
dict
1 parent 787ae30 commit 184f815

9 files changed

+178
-0
lines changed

choice_read.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PAPER_CHOICES = [
2+
(1, '1st Paper'),
3+
(2, '2nd Paper'),
4+
]
5+
6+
print(PAPER_CHOICES[0][0])
7+
8+
9+
for papers in PAPER_CHOICES:
10+
for p in papers:
11+
print(p)

choicetodict.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CLASS_CHOICES =[
2+
(1,"VII"),
3+
(2,"VIII"),
4+
(3,"IX"),
5+
(4,"X"),
6+
(5,"SSC Candidate"),
7+
(6,"XI"),
8+
(7,"XII"),
9+
(8,"HSC Candidate"),
10+
]
11+
12+
choice_to_dict =dict(CLASS_CHOICES)
13+
14+
print(choice_to_dict)
15+
16+
17+
normaldict={
18+
1:'hi',
19+
}
20+
21+
print(normaldict[1])

dict_keys.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
d = {'first':'string value', 'second':[1,2]}
2+
3+
4+
5+
6+
7+
# vowels keys
8+
keys = {'a', 'e', 'i', 'o', 'u' }
9+
10+
vowels = dict.fromkeys(keys)
11+
print(vowels)

edu/new_voc_words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
abstinence,acquaint,acquit,adolescent,adjacent,aesthetic,affinity,anoint,amputee,anecdotal,angst,apt ,auspicious,avocation,bolster,bonafide,clandestine,collinearity,commencement,complacent,contagious,corrosive,credentials,chronologically,cussed,danker,deemed,depicted,diaspora,discern,dubious,eminent,emissary,exaggerate,farsightedness,facet,fiscal,foxed by the beauty,frowning,glean,goof-up,grimace,hinterland,holistic,imminent,impervious,impulsive,incensed,incisive,incentive,infiltrate,inflation,intricacies,intuition,Know-all,meneuver,merely,mettle,meticulous,numerous,outregous,paramount,percapita,persecution,perpetuity,plead,prop-up,preposterous,satiate,scalp,scripture,Scrutinizing,secluded,sedate,shelved,solemnly,sphere,stifled,staid,stumble,surge,superfluous ,reciprocal,reminisced,renunciation,rigor,tedious,tenacious,tenant,tilling,tumultuous,whimsical,woeful,vanquishers,vicinity,vigil,

edu/voc_words.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
file = open("/home/linkon/Desktop/python/edu/voc_words.txt","r")
2+
3+
wordlist = file.readlines()
4+
5+
print(wordlist)
6+
7+
length = len(wordlist)
8+
9+
print(length)
10+
# for word in wordlist:
11+
# word
12+
13+
14+
for i in range(length):
15+
wordlist[i] = wordlist[i].replace("\n","")
16+
17+
new_file = open("/home/linkon/Desktop/python/edu/new_voc_words.txt","w+")
18+
19+
for word in wordlist:
20+
new_file.write(word+",")
21+
22+
23+
24+

edu/voc_words.txt

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
abstinence
2+
acquaint
3+
acquit
4+
adolescent
5+
adjacent
6+
aesthetic
7+
affinity
8+
anoint
9+
amputee
10+
anecdotal
11+
angst
12+
apt
13+
auspicious
14+
avocation
15+
bolster
16+
bonafide
17+
clandestine
18+
collinearity
19+
commencement
20+
complacent
21+
contagious
22+
corrosive
23+
credentials
24+
chronologically
25+
cussed
26+
danker
27+
deemed
28+
depicted
29+
diaspora
30+
discern
31+
dubious
32+
eminent
33+
emissary
34+
exaggerate
35+
farsightedness
36+
facet
37+
fiscal
38+
foxed by the beauty
39+
frowning
40+
glean
41+
goof-up
42+
grimace
43+
hinterland
44+
holistic
45+
imminent
46+
impervious
47+
impulsive
48+
incensed
49+
incisive
50+
incentive
51+
infiltrate
52+
inflation
53+
intricacies
54+
intuition
55+
Know-all
56+
meneuver
57+
merely
58+
mettle
59+
meticulous
60+
numerous
61+
outregous
62+
paramount
63+
percapita
64+
persecution
65+
perpetuity
66+
plead
67+
prop-up
68+
preposterous
69+
satiate
70+
scalp
71+
scripture
72+
Scrutinizing
73+
secluded
74+
sedate
75+
shelved
76+
solemnly
77+
sphere
78+
stifled
79+
staid
80+
stumble
81+
surge
82+
superfluous
83+
reciprocal
84+
reminisced
85+
renunciation
86+
rigor
87+
tedious
88+
tenacious
89+
tenant
90+
tilling
91+
tumultuous
92+
whimsical
93+
woeful
94+
vanquishers
95+
vicinity
96+
vigil

if.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
A = [1,2,3]
2+
B = [3,5,7]
3+
4+
5+
if 3 in A and 3 in B:
6+
print ("ok")

list_with_for.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import datetime
2+
3+
years = [i for i in range(2000, datetime.datetime.now().year+5)]
4+
5+
print(years)

listcompre.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
somelist = [x for x in range(1,9)]
2+
3+
print(somelist)

0 commit comments

Comments
 (0)