Skip to content

Commit 9f6be24

Browse files
Add files via upload
1 parent 78d1b22 commit 9f6be24

10 files changed

+3406
-0
lines changed
+272
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"****\n",
8+
"***\n",
9+
"**\n",
10+
"*"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 9,
16+
"metadata": {
17+
"scrolled": true
18+
},
19+
"outputs": [
20+
{
21+
"name": "stdout",
22+
"output_type": "stream",
23+
"text": [
24+
"4\n",
25+
"****\n",
26+
"***\n",
27+
"**\n",
28+
"*\n"
29+
]
30+
}
31+
],
32+
"source": [
33+
"n = int(input())\n",
34+
"i = 1\n",
35+
"while i<=n:\n",
36+
" j = 1\n",
37+
" while j <= n-i+1:\n",
38+
" print('*',end='') \n",
39+
" j = j +1\n",
40+
" print() \n",
41+
" i = i+1"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 5,
47+
"metadata": {
48+
"scrolled": true
49+
},
50+
"outputs": [
51+
{
52+
"name": "stdout",
53+
"output_type": "stream",
54+
"text": [
55+
"4\n",
56+
"1111\n",
57+
"000\n",
58+
"11\n",
59+
"0\n"
60+
]
61+
}
62+
],
63+
"source": [
64+
"n = int(input())\n",
65+
"i = 1\n",
66+
"while i <= n:\n",
67+
" j =1\n",
68+
" while j<= n-i+1:\n",
69+
" print(i%2,end='')\n",
70+
" j = j+1\n",
71+
" print()\n",
72+
" i = i + 1"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": 26,
78+
"metadata": {
79+
"scrolled": true
80+
},
81+
"outputs": [
82+
{
83+
"name": "stdout",
84+
"output_type": "stream",
85+
"text": [
86+
"4\n",
87+
"A\n",
88+
"BB\n",
89+
"CCC\n",
90+
"DDDD\n"
91+
]
92+
}
93+
],
94+
"source": [
95+
"n = int(input())\n",
96+
"\n",
97+
"i = 1\n",
98+
"\n",
99+
"while i <= n:\n",
100+
" \n",
101+
" char = chr(ord('A') + i - 1)\n",
102+
" \n",
103+
" j = 1\n",
104+
" \n",
105+
" while j <= i:\n",
106+
" print(char, end=\"\")\n",
107+
" j += 1\n",
108+
" \n",
109+
" print()\n",
110+
" i +=1"
111+
]
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": 1,
116+
"metadata": {},
117+
"outputs": [
118+
{
119+
"name": "stdout",
120+
"output_type": "stream",
121+
"text": [
122+
"4\n",
123+
"1\n",
124+
"11\n",
125+
"121\n",
126+
"1221\n"
127+
]
128+
}
129+
],
130+
"source": [
131+
"n=int(input())\n",
132+
"i=1\n",
133+
"while i<=n:\n",
134+
" j=1\n",
135+
" while j<=i:\n",
136+
" if i==1:\n",
137+
" print('1',end='')\n",
138+
" elif j==1 or i==j:\n",
139+
" print('1',end='')\n",
140+
" else:\n",
141+
" print('2',end='')\n",
142+
" j=j+1\n",
143+
" print()\n",
144+
" i=i+1"
145+
]
146+
},
147+
{
148+
"cell_type": "code",
149+
"execution_count": 3,
150+
"metadata": {
151+
"scrolled": true
152+
},
153+
"outputs": [
154+
{
155+
"name": "stdout",
156+
"output_type": "stream",
157+
"text": [
158+
"4\n",
159+
"D\n",
160+
"CD\n",
161+
"BCD\n",
162+
"ABCD\n"
163+
]
164+
}
165+
],
166+
"source": [
167+
"n = int(input())\n",
168+
"i = n\n",
169+
"while i >= 1:\n",
170+
" j = i\n",
171+
" while j<=n:\n",
172+
" print(chr(ord(\"A\")+j-1),end=\"\")\n",
173+
" j = j + 1\n",
174+
" print()\n",
175+
" i = i - 1"
176+
]
177+
},
178+
{
179+
"cell_type": "code",
180+
"execution_count": 1,
181+
"metadata": {
182+
"scrolled": true
183+
},
184+
"outputs": [
185+
{
186+
"name": "stdout",
187+
"output_type": "stream",
188+
"text": [
189+
"4\n",
190+
"1234\n",
191+
"123\n",
192+
"12\n",
193+
"1\n"
194+
]
195+
}
196+
],
197+
"source": [
198+
"n = int(input())\n",
199+
"i = 1\n",
200+
"while i<=n:\n",
201+
" j = 1\n",
202+
" p =1\n",
203+
" while j <= n-i+1:\n",
204+
" print(p,end='') \n",
205+
" j = j +1\n",
206+
" p =p+1\n",
207+
" print() \n",
208+
" i = i+1"
209+
]
210+
},
211+
{
212+
"cell_type": "code",
213+
"execution_count": 18,
214+
"metadata": {
215+
"scrolled": true
216+
},
217+
"outputs": [
218+
{
219+
"name": "stdout",
220+
"output_type": "stream",
221+
"text": [
222+
"5\n",
223+
"1 2 3 4 5 \n",
224+
"11 12 13 14 15 \n",
225+
"21 22 23 24 25 \n",
226+
"16 17 18 19 20 \n",
227+
"6 7 8 9 10 \n"
228+
]
229+
}
230+
],
231+
"source": [
232+
"n=int(input())\n",
233+
"s=1\n",
234+
"for i in range (1,n+1):\n",
235+
" for j in range(s,s+n):\n",
236+
" print(j ,end=\" \")\n",
237+
" print()\n",
238+
" if (i==((n+1)//2)):\n",
239+
" if n%2!=0:\n",
240+
" s=n*(n-2)+1\n",
241+
" else:\n",
242+
" s=n*(n-1)+1\n",
243+
" continue\n",
244+
" if (i>(n+1)//2):\n",
245+
" s=s-2*n\n",
246+
" else:\n",
247+
" s=s+2*n"
248+
]
249+
}
250+
],
251+
"metadata": {
252+
"kernelspec": {
253+
"display_name": "Python 3",
254+
"language": "python",
255+
"name": "python3"
256+
},
257+
"language_info": {
258+
"codemirror_mode": {
259+
"name": "ipython",
260+
"version": 3
261+
},
262+
"file_extension": ".py",
263+
"mimetype": "text/x-python",
264+
"name": "python",
265+
"nbconvert_exporter": "python",
266+
"pygments_lexer": "ipython3",
267+
"version": "3.8.5"
268+
}
269+
},
270+
"nbformat": 4,
271+
"nbformat_minor": 4
272+
}

0 commit comments

Comments
 (0)