Skip to content

Commit 56835b2

Browse files
committed
Add Value into List
1 parent 51463ef commit 56835b2

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Input.ipynb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,47 @@
8282
"print (\"type of name\", type(name1)) \n"
8383
]
8484
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": 5,
88+
"metadata": {},
89+
"outputs": [
90+
{
91+
"name": "stdin",
92+
"output_type": "stream",
93+
"text": [
94+
"Enter number of elements : 5\n",
95+
" 1\n",
96+
" 2\n",
97+
" 3\n",
98+
" 4\n",
99+
" 5\n"
100+
]
101+
},
102+
{
103+
"name": "stdout",
104+
"output_type": "stream",
105+
"text": [
106+
"['1', '2', '3', '4', '5']\n"
107+
]
108+
}
109+
],
110+
"source": [
111+
"# creating an empty list \n",
112+
"lst = [] \n",
113+
" \n",
114+
"# number of elemetns as input \n",
115+
"n = int(input(\"Enter number of elements : \")) \n",
116+
" \n",
117+
"# iterating till the range \n",
118+
"for i in range(0, n): \n",
119+
" ele =input()\n",
120+
" \n",
121+
" lst.append(ele) # adding the element \n",
122+
" \n",
123+
"print(lst) "
124+
]
125+
},
85126
{
86127
"cell_type": "code",
87128
"execution_count": null,

0 commit comments

Comments
 (0)