Skip to content

Commit f6a1406

Browse files
committed
pattern
1 parent f9f177c commit f6a1406

File tree

2 files changed

+232
-0
lines changed

2 files changed

+232
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 4,
6+
"id": "96c38415",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"p\n",
14+
"py\n",
15+
"pyt\n",
16+
"pyth\n",
17+
"pytho\n",
18+
"python\n",
19+
"pytho\n",
20+
"pyth\n",
21+
"pyt\n",
22+
"py\n",
23+
"p\n",
24+
"\n"
25+
]
26+
}
27+
],
28+
"source": [
29+
"string = \"python\"\n",
30+
"x = 0\n",
31+
"\n",
32+
"for i in string :\n",
33+
" x = x + 1\n",
34+
" print(string[0 : x])\n",
35+
"\n",
36+
"for i in string :\n",
37+
" x = x - 1\n",
38+
" print(string[0 : x])"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": 7,
44+
"id": "471fe263",
45+
"metadata": {},
46+
"outputs": [
47+
{
48+
"name": "stdout",
49+
"output_type": "stream",
50+
"text": [
51+
"enter your string : ahmedabad\n",
52+
"a\n",
53+
"ah\n",
54+
"ahm\n",
55+
"ahme\n",
56+
"ahmed\n",
57+
"ahmeda\n",
58+
"ahmedab\n",
59+
"ahmedaba\n",
60+
"ahmedabad\n",
61+
"ahmedaba\n",
62+
"ahmedab\n",
63+
"ahmeda\n",
64+
"ahmed\n",
65+
"ahme\n",
66+
"ahm\n",
67+
"ah\n",
68+
"a\n",
69+
"\n"
70+
]
71+
}
72+
],
73+
"source": [
74+
"string = input('enter your string : ')\n",
75+
"x = 0\n",
76+
"\n",
77+
"for i in string :\n",
78+
" x = x + 1\n",
79+
" print(string[0 : x])\n",
80+
"\n",
81+
"for i in string :\n",
82+
" x = x - 1\n",
83+
" print(string[0 : x])"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"id": "a164f779",
90+
"metadata": {},
91+
"outputs": [],
92+
"source": []
93+
}
94+
],
95+
"metadata": {
96+
"kernelspec": {
97+
"display_name": "Python 3 (ipykernel)",
98+
"language": "python",
99+
"name": "python3"
100+
},
101+
"language_info": {
102+
"codemirror_mode": {
103+
"name": "ipython",
104+
"version": 3
105+
},
106+
"file_extension": ".py",
107+
"mimetype": "text/x-python",
108+
"name": "python",
109+
"nbconvert_exporter": "python",
110+
"pygments_lexer": "ipython3",
111+
"version": "3.9.13"
112+
}
113+
},
114+
"nbformat": 4,
115+
"nbformat_minor": 5
116+
}

Python_Pattern.ipynb

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 4,
6+
"id": "96c38415",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"p\n",
14+
"py\n",
15+
"pyt\n",
16+
"pyth\n",
17+
"pytho\n",
18+
"python\n",
19+
"pytho\n",
20+
"pyth\n",
21+
"pyt\n",
22+
"py\n",
23+
"p\n",
24+
"\n"
25+
]
26+
}
27+
],
28+
"source": [
29+
"string = \"python\"\n",
30+
"x = 0\n",
31+
"\n",
32+
"for i in string :\n",
33+
" x = x + 1\n",
34+
" print(string[0 : x])\n",
35+
"\n",
36+
"for i in string :\n",
37+
" x = x - 1\n",
38+
" print(string[0 : x])"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": 7,
44+
"id": "471fe263",
45+
"metadata": {},
46+
"outputs": [
47+
{
48+
"name": "stdout",
49+
"output_type": "stream",
50+
"text": [
51+
"enter your string : ahmedabad\n",
52+
"a\n",
53+
"ah\n",
54+
"ahm\n",
55+
"ahme\n",
56+
"ahmed\n",
57+
"ahmeda\n",
58+
"ahmedab\n",
59+
"ahmedaba\n",
60+
"ahmedabad\n",
61+
"ahmedaba\n",
62+
"ahmedab\n",
63+
"ahmeda\n",
64+
"ahmed\n",
65+
"ahme\n",
66+
"ahm\n",
67+
"ah\n",
68+
"a\n",
69+
"\n"
70+
]
71+
}
72+
],
73+
"source": [
74+
"string = input('enter your string : ')\n",
75+
"x = 0\n",
76+
"\n",
77+
"for i in string :\n",
78+
" x = x + 1\n",
79+
" print(string[0 : x])\n",
80+
"\n",
81+
"for i in string :\n",
82+
" x = x - 1\n",
83+
" print(string[0 : x])"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"id": "a164f779",
90+
"metadata": {},
91+
"outputs": [],
92+
"source": []
93+
}
94+
],
95+
"metadata": {
96+
"kernelspec": {
97+
"display_name": "Python 3 (ipykernel)",
98+
"language": "python",
99+
"name": "python3"
100+
},
101+
"language_info": {
102+
"codemirror_mode": {
103+
"name": "ipython",
104+
"version": 3
105+
},
106+
"file_extension": ".py",
107+
"mimetype": "text/x-python",
108+
"name": "python",
109+
"nbconvert_exporter": "python",
110+
"pygments_lexer": "ipython3",
111+
"version": "3.9.13"
112+
}
113+
},
114+
"nbformat": 4,
115+
"nbformat_minor": 5
116+
}

0 commit comments

Comments
 (0)