Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions your-project/.gitignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Created by https://www.toptal.com/developers/gitignore/api/jupyternotebooks
# Edit at https://www.toptal.com/developers/gitignore?templates=jupyternotebooks

### JupyterNotebooks ###
# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/

.ipynb_checkpoints
*/.ipynb_checkpoints/*

# IPython
profile_default/
ipython_config.py

# Remove previous ipynb_checkpoints
# git rm -r .ipynb_checkpoints/

# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks
119 changes: 119 additions & 0 deletions your-project/Project Week1 Password Generator.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"import string\n",
"\n",
"\n",
"num_char = 0\n",
"\n",
"while num_char < 4 or num_char > 32:\n",
" try :\n",
" num_char=int(input(\"How many characters do you want your password to be? Instructions: Enter an integer number between 4 and 32.\\n\"))\n",
" if num_char < 4 or num_char > 32:\n",
" print(\"The number should be between 4 and 32\")\n",
" except ValueError:\n",
" print(\"This is not an integer!\")\n",
" \n",
" \n",
"uppercase=''\n",
"while uppercase.lower() != \"y\" and uppercase.lower() != \"n\":\n",
" uppercase=input(\"Would you like to include uppercase letters? Instructions: Answer with Y for Yes and N for No\\n\")\n",
" if uppercase.lower() != \"y\" and uppercase.lower() != \"n\":\n",
" print(\"Answer with Y or N!\")\n",
" \n",
"\n",
"lowercase=''\n",
"while lowercase.lower() != \"y\" and lowercase.lower() != \"n\":\n",
" lowercase=input(\"Would you like to include lowercase letters? Instructions: Answer with Y for Yes and N for No\\n\")\n",
" if lowercase.lower() != \"y\" and lowercase.lower() != \"n\":\n",
" print(\"Answer with Y or N!\")\n",
" \n",
" \n",
"number=''\n",
"while number.lower() != \"y\" and number.lower() != \"n\":\n",
" number=input(\"Would you like to include numbers? Instructions: Answer with Y for Yes and N for No\\n\")\n",
" if number.lower() != \"y\" and number.lower() != \"n\":\n",
" print(\"Answer with Y or N!\")\n",
" \n",
" \n",
"symbols=''\n",
"while symbols.lower() != \"y\" and symbols.lower() != \"n\":\n",
" symbols=input(\"Would you like to include symbols? Instructions: Answer with Y for Yes and N for No\\n\")\n",
" if symbols.lower() != \"y\" and symbols.lower() != \"n\":\n",
" print(\"Answer with Y or N!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def password_generator(lenght, upper, lower, num, symb):\n",
" password_list=\"\"\n",
" password=\"\"\n",
" if lower.lower()==\"n\" and upper.lower()==\"n\" and num.lower()==\"n\" and symb.lower()==\"n\":\n",
" return print('Do you want a password or not after all?!?')\n",
" \n",
" if lower.lower()==\"y\":\n",
" password_list=password_list + string.ascii_lowercase\n",
" \n",
" if upper.lower()==\"y\":\n",
" password_list=password_list + string.ascii_uppercase\n",
" \n",
" if num.lower()==\"y\":\n",
" password_list=password_list + string.digits\n",
" \n",
" if symb.lower()==\"y\":\n",
" password_list=password_list + string.punctuation\n",
" \n",
" for i in range(lenght):\n",
" password=password + \"\".join(random.choice(password_list))\n",
" return password"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"password_generator(lenght = num_char, upper=uppercase , lower = lowercase , num = number, symb = symbols)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}