Skip to content

Commit 9aac877

Browse files
committed
Check Repeation
1 parent 7a03fd4 commit 9aac877

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Dictionaries.ipynb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,38 @@
290290
"print(mydict)"
291291
]
292292
},
293+
{
294+
"cell_type": "code",
295+
"execution_count": 18,
296+
"metadata": {},
297+
"outputs": [
298+
{
299+
"name": "stdin",
300+
"output_type": "stream",
301+
"text": [
302+
"Enter ip 1111111111\n"
303+
]
304+
},
305+
{
306+
"name": "stdout",
307+
"output_type": "stream",
308+
"text": [
309+
"{'1': 10}\n"
310+
]
311+
}
312+
],
313+
"source": [
314+
"strl=input(\"Enter ip\")\n",
315+
"dictX = {} \n",
316+
"for i in strl: \n",
317+
" if i not in dictX.keys(): \n",
318+
" dictX[i] = 1\n",
319+
" else: \n",
320+
" dictX[i] += 1\n",
321+
" \n",
322+
"print (dictX)"
323+
]
324+
},
293325
{
294326
"cell_type": "code",
295327
"execution_count": null,

0 commit comments

Comments
 (0)