Skip to content

Commit ff9de4d

Browse files
committed
Merge pull request #112
2 parents b6456ae + 63f63e3 commit ff9de4d

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

notebooks/Day_06.ipynb

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,37 @@
189189
"print(\",\".join(lst))"
190190
]
191191
},
192+
{
193+
"cell_type": "markdown",
194+
"metadata": {},
195+
"source": [
196+
"### Here is another solution for Ques 18(by Vikranttyagi95)"
197+
]
198+
},
199+
{
200+
"cell_type": "code",
201+
"execution_count": null,
202+
"metadata": {},
203+
"outputs": [],
204+
"source": [
205+
"import string\n",
206+
"\n",
207+
"passwords = input(\"Please enter passwords: \").split(',')\n",
208+
"\n",
209+
"def char_cond(password):\n",
210+
" return any(char in password for char in string.ascii_lowercase)\n",
211+
"\n",
212+
"def digit_cond(password):\n",
213+
" return any(char in password for char in string.digits)\n",
214+
"\n",
215+
"def special_cond(password):\n",
216+
" return any(char in password for char in \"$#@\")\n",
217+
"\n",
218+
"for password in passwords:\n",
219+
" if 6 <= len(password) <=12 and char_cond(password) and digit_cond(password) and special_cond(password):\n",
220+
" print(password) "
221+
]
222+
},
192223
{
193224
"cell_type": "markdown",
194225
"metadata": {},
@@ -262,7 +293,7 @@
262293
],
263294
"metadata": {
264295
"kernelspec": {
265-
"display_name": "Python 3",
296+
"display_name": "Python 3 (ipykernel)",
266297
"language": "python",
267298
"name": "python3"
268299
},
@@ -276,7 +307,20 @@
276307
"name": "python",
277308
"nbconvert_exporter": "python",
278309
"pygments_lexer": "ipython3",
279-
"version": "3.7.6"
310+
"version": "3.9.5"
311+
},
312+
"toc": {
313+
"base_numbering": 1,
314+
"nav_menu": {},
315+
"number_sections": true,
316+
"sideBar": true,
317+
"skip_h1_title": false,
318+
"title_cell": "Table of Contents",
319+
"title_sidebar": "Contents",
320+
"toc_cell": false,
321+
"toc_position": {},
322+
"toc_section_display": true,
323+
"toc_window_display": false
280324
}
281325
},
282326
"nbformat": 4,

0 commit comments

Comments
 (0)