-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.Q.5 .py
59 lines (52 loc) · 1.05 KB
/
file.Q.5 .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
57
58
# name='''rishabh - meerut
# imtiyaz - delhi
# nilima - cochin
# rati - shimla
# ayishah - delhi
# raghu - shimla
# naseer - kanpur
# karthikeyan - delhi
# salma - jaipur
# pankaj - delhi
# brijesh - delhi
# govind - delhi
# puneet - shimla
# tanuja - Ahmednagar
# siddhi - delhi
# suman - jaipur
# rajeev - shimla
# mohinder - delhi
# rajendra - jaipur
# priyanka - shimla
# neela - delhi
# sashi - jaipur
# sarika - delhi
# deepti - shimla
# harshad - delhi
# trishna - raipur
# pradeep - jaipur
# sekhar - delhi
# nand - delhi
# anoop - delhi
# balwinder - tokyo'''
# o=open("listofdelhi.txt","w")
# o.write(name)
# o.close()
b=open("listofdelhi.txt","r")
f=b.read().splitlines()
for i in f:
if 'delhi' in i:
f=open("*delhi.txt",'a')
f.write(i)
f.write('\n')
f.close()
if 'shimla' in i:
f=open("*shimla.txt","a")
f.write(i)
f.write('\n')
f.close()
if 'delhi'not in i and 'shimla' not in i:
f=open("*other states.txt","a")
f.write(i)
f.write('\n')
f.close()