forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonu class 11th.py
More file actions
281 lines (245 loc) · 7.88 KB
/
sonu class 11th.py
File metadata and controls
281 lines (245 loc) · 7.88 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
def keys_values_and_items():
S={'a':30, 'b':40, 'c':50, 'd':60}
S.keys()
for y in S.keys():
i=print(y)
P={'a':120, 'b':340, 'c':650, 'd':860}
P.values()
for z in P.values():
r=print(z)
A={'a':30, 'b':40, 'c':50, 'd':60}
A.items()
for t in A.items():
print(t)
def keys_values_and_items():
S={1:20, 2:40, 3:50, 4:60, 5:80, 6:100}
S.keys()
for y in S.keys():
print('keys',y)
P={'a':120, 'b':340, 'c':650, 'd':860, 'e':80, 'f':100}
P.values()
for z in P.values():
print('values',z)
A={3:30, 4:40, 9:50, 4:60, 7:78}
A.items()
for t in A.items():
print('items',t)
def keys_values_and_items():
S={'a':20, 'b':40, 'c':50, 'd':60}
S.keys()
for y in S.keys():
print('keys',y)
P={'a':120, 'b':340, 'c':650, 'd':860}
P.values()
for z in P.values():
print('values',z)
A={'a':30, 'b':40, 'c':50, 'd':60}
A.items()
for t in A.items():
print('items',t)
def keys_values_and_items():
S={'a':30, 'b':40, 'c':50, 'd':60}
S.keys()
for y in S.keys():
print(y)
P={'a':120, 'b':340, 'c':650, 'd':860}
P.values()
for z in P.values():
print(z)
A={'a':30, 'b':40, 'c':50, 'd':60}
A.items()
for t in A.items():
print(t)
def counting_number():
list1=[20,20,10,30,40,50,60,70,10,10,40]
num=eval(input("enter the number:"))
count=0
for i in list1:
if num ==i:
count=count+1
print(num,"is present" , count, " number of times")
def salute():
print("enter you name:")
name=input()
print("ok"+name)
def reversible():
str=input("enter the string:")
for i in range(-1,-len(str)-1,-1):
print(str[i],end=' ')
def main():
a=[50,45,56,19,37,48,56,90,6,7,2,4,3,2,34,4,21,333,66,3,55,32,]
print("original list : ",a)
for i in a:
j=a.index(i)
while j>0:
if a [j-1] > a[j]:
a[j-1] ,a[j] = a[j],a[j-1]
else:
break
j=j-1
print("list after unsortingsorting : " , a)
def main1():
a=[50,45,56,19,37,48,56,90,6,7,2,4,3,2,34,4,21,333,66,3,55,32,]
print("original list : ",a)
for i in a:
j=a.index(i)
while j>0:
if a [j-1] > a[j]:
a[j-1] ,a[j] = a[j],a[j-1]
else:
break
j=j-1
print("list after sorted : " , a)
def created():
p=tuple()
n=int(input("enter the number of element :"))
i=1
while(i>=n):
a=input("enter the number:")
i=i+1
print("tuple created as:")
print(i)
def created2():
p=tuple()
n=int(input("enter the number of element :"))
i=1
while(i<=n):
a=input("enter the number:")
i=i-1
print("tuple created as:")
print(i)
def marks():
a=int(input("enter the S_NO.:"))
b=int(input("enter the Roll no.:" ))
c=int(input("enter the name:"))
d=int(input("enter the marks:"))
print('a','b','c','d')
for i in range (0,len('a','b','c','d')):
print((i+'a'),'\t','a','b','c','d'[i][0],'\t','a','b','c','d'[i][1],'\t','a','b','c','d'[i][2])
def reverseorder():
tup= (10,20,30,40,50,60,70,80,90,100)
print("original tuple is:")
for i in range(0,len(tup)):
print(tup[i])
print("tuple elements in reverse order:")
for i in range(len(tup)-1,-1,-1):
print(tup[i])
def reverseorder2():
tup= ('rudra','amit','sonu','brijesh','manish','raja','shubham')
print("original tuple is:")
for i in range(0,len(tup)):
print(tup[i])
print("tuple elements in reverse order:")
for i in range(len(tup)-1,-1,-1):
print(tup[i])
def countingthenumber():
print("enter the numbers seprated by comma:")
t1=tuple([int(e) for e in input().split(',')])
i=0
for e in t1:
if i ==t1.index(e):
print(e, ' - ',t1.count(e))
i+=1
def information():
D={'Name':"Rudra pratap",'Gender':'Male','DOB':'20-10-2009'}
print(D)
D_Name=D.setdefault('Name',"Name not Available:")
D_DOB=D.setdefault('DOB',"Date not Available")
D_Gender=D.setdefault('Gend')
D_Mobile=D.setdefault('Mobile')
print("Name:",D_Name)
print("DOB:",D_DOB)
print("Gender:",D_Gender)
print("Mobile:",D_Mobile)
def employe():
D1=str(input("enter the name:"))
D2=str(input("enter the phone number:"))
D3=str(input("enter the address:"))
print("Name:",D1)
print("phone number:",D2)
print("address:",D3)
def employe2():
D={"sonu":9534721166,"rudra":8506837992,"amit":9818525709,"manish":7011189922,"shubham":8076794458}
print(D)
D1=str(input("enter the name:"))
D2=str(input("enter the phone number:"))
D3=str(input("enter the address:"))
print("Name:",D1,D)
print("phone number:",D2,D)
print("address:",D3,D)
'''
print("This program is made to create and edit various lists and then create a masterlist out of them ")
c='y'
y=1
Masterlist = []
while c=='y' or c=='Y':
print("For List",y," : ")
x=input("Enter the name of your list : \n")
w=[]
c1='y'
while c1=='y' or c1=='Y':
print("MAIN MENU","If you want to add an element type E or e",
"If your list is complete type C or c (NOTE: You cannot further change you list)",
"If you want to delete an element type D or d", sep = '\n')
z=input()
if z=='E' or z=='e' :
k='y'
while k=='Y' or k=='y':
o=eval(input('Enter the Element you want to add to your list [Note: is str use quotes]'))
w.append(o)
print("The list",x," is \n",w,)
k=input("Do you want to add another element to your list (Y/N) \n")
elif z=='C' or z=='c':
c1='n'
elif z=='d' or 'D':
k='y'
while k=='Y' or k=='y':
i=eval(input("Enter the element you want to remove from your list"))
if i in w :
w.remove(i)
else :
print("You entered an Element not in your list")
k=input("Do you want to delete another element from your list (Y/N) \n")
Masterlist.append(w)
print("Your List",x," is : \n",w,)
print("Your Masterlist is : \n",Masterlist)
y+=1
c=input("Do you want to add another list to your masterlist (Y/N) \n")
print("The Master List is : ",Masterlist,) '''
def time():
T=int(input("enter the time:"))
for T in range(T-1):
print(T)
def time2():
T=int(input("enter the time:"))
for T in range(T-1,T):
print(T)
def multiply():
R=int(input("enter the number:"))
for n in range(R):
print(n*100)
def sum():
sum=0
n=int(input("How many terms:"))
for a in range(2,n+2):
term=0
for b in range(1,a):
term+=b
print('term',(a-1),':',term)
sum+=term
print('sum of',n,'term is:',sum)
def sum2():
sum=0
n=int(input("How many terms:"))
for a in range(-123,n-1):
term=0
for b in range(-1,a):
term+=b
print('term',(a-1),':',term)
sum+=term
print('sum of',n,'term is:',sum)
def sor():
for i in range(1,4):
for j in range(1,i+1):
print(j,end=' ')
print(j)