Skip to content

Commit 67e0582

Browse files
Add files via upload
1 parent a7b359a commit 67e0582

1 file changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<small><small><i>\n",
8+
"All the IPython Notebooks in this example series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/90_Python_Examples)**\n",
9+
"</i></small></small>"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 20,
15+
"metadata": {},
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"Enter number of rows: 7\n",
22+
"*******\n",
23+
" ******\n",
24+
" *****\n",
25+
" ****\n",
26+
" ***\n",
27+
" **\n",
28+
" *\n"
29+
]
30+
},
31+
{
32+
"data": {
33+
"text/plain": [
34+
"'\\n>>Output/Runtime Test Cases\\n \\nCase 1:\\nEnter a number: 4\\n1 0 0 0 \\n0 1 0 0 \\n0 0 1 0 \\n0 0 0 1 \\n \\nCase 2:\\nEnter a number: 5\\n1 0 0 0 0 \\n0 1 0 0 0 \\n0 0 1 0 0 \\n0 0 0 1 0 \\n0 0 0 0 1\\n'"
35+
]
36+
},
37+
"execution_count": 20,
38+
"metadata": {},
39+
"output_type": "execute_result"
40+
}
41+
],
42+
"source": [
43+
"<small><small><i>\n",
44+
"All the IPython Notebooks in this example series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/90_Python_Examples)**\n",
45+
"</i></small></small># Here is source code of the Python Program to ...\n",
46+
"# The program output is also shown below.\n",
47+
"\n",
48+
"n=int(input(\"Enter number of rows: \"))\n",
49+
"for i in range (n,0,-1):\n",
50+
" print((n-i) * ' ' + i * '*')\n",
51+
"\n",
52+
"\n",
53+
"\n",
54+
"'''\n",
55+
">>Output/Runtime Test Cases\n",
56+
" \n",
57+
"Case 1:\n",
58+
"Enter a number: 4\n",
59+
"1 0 0 0 \n",
60+
"0 1 0 0 \n",
61+
"0 0 1 0 \n",
62+
"0 0 0 1 \n",
63+
" \n",
64+
"Case 2:\n",
65+
"Enter a number: 5\n",
66+
"1 0 0 0 0 \n",
67+
"0 1 0 0 0 \n",
68+
"0 0 1 0 0 \n",
69+
"0 0 0 1 0 \n",
70+
"0 0 0 0 1\n",
71+
"'''"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {},
78+
"outputs": [],
79+
"source": []
80+
}
81+
],
82+
"metadata": {
83+
"hide_input": false,
84+
"kernelspec": {
85+
"display_name": "Python 3",
86+
"language": "python",
87+
"name": "python3"
88+
},
89+
"language_info": {
90+
"codemirror_mode": {
91+
"name": "ipython",
92+
"version": 3
93+
},
94+
"file_extension": ".py",
95+
"mimetype": "text/x-python",
96+
"name": "python",
97+
"nbconvert_exporter": "python",
98+
"pygments_lexer": "ipython3",
99+
"version": "3.8.8"
100+
},
101+
"toc": {
102+
"base_numbering": 1,
103+
"nav_menu": {},
104+
"number_sections": true,
105+
"sideBar": true,
106+
"skip_h1_title": false,
107+
"title_cell": "Table of Contents",
108+
"title_sidebar": "Contents",
109+
"toc_cell": false,
110+
"toc_position": {},
111+
"toc_section_display": true,
112+
"toc_window_display": false
113+
},
114+
"varInspector": {
115+
"cols": {
116+
"lenName": 16,
117+
"lenType": 16,
118+
"lenVar": 40
119+
},
120+
"kernels_config": {
121+
"python": {
122+
"delete_cmd_postfix": "",
123+
"delete_cmd_prefix": "del ",
124+
"library": "var_list.py",
125+
"varRefreshCmd": "print(var_dic_list())"
126+
},
127+
"r": {
128+
"delete_cmd_postfix": ") ",
129+
"delete_cmd_prefix": "rm(",
130+
"library": "var_list.r",
131+
"varRefreshCmd": "cat(var_dic_list()) "
132+
}
133+
},
134+
"types_to_exclude": [
135+
"module",
136+
"function",
137+
"builtin_function_or_method",
138+
"instance",
139+
"_Feature"
140+
],
141+
"window_display": false
142+
}
143+
},
144+
"nbformat": 4,
145+
"nbformat_minor": 4
146+
}

0 commit comments

Comments
 (0)