Skip to content

Commit cf092ed

Browse files
Add files via upload
1 parent 7a763d4 commit cf092ed

1 file changed

Lines changed: 138 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)