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
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### 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/
94 changes: 0 additions & 94 deletions Kick-Off.md

This file was deleted.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<img src="https://bit.ly/2VnXWr2" alt="Ironhack Logo" width="100"/>

# Random Password Generator
*[Kübra Bektas]*

*[DAFT, Remote & 2021-06-03]*

## Content
- [Project Description](#project-description)
- [Rules](#rules)
- [Workflow](#workflow)
- [Organization](#organization)
- [Links](#links)

## Project Description <a class="anchor" id="project-description"></a>
This project is a simple random password generator, which lets you decide the length and the type of characters. This project was chosen as password generators are useful and always in need.

## Rules <a class="anchor" id="rules"></a>
To use this generator the user has to make inputs regarding the length, and if the password should contain letters, numbers and/or symbols.

## Workflow <a class="anchor" id="workflow"></a>
The first step was to research different possibilities on random choice in python. After getting basic knowledge and a quick brainstorming the kanban board was created on Notion and the required steps were written down. Afterwards all needed code snippets were written into the Jupyter Notebook and after several trial and errors the first working code was created.

## Organization <a class="anchor" id="organization"></a>
The organization of the work occured on Notion and manually on paper for quick notes.

The repository contains a folder named "your-code" a README file and also a gitignore file. The "your-code" folder contains the Jupyter file with the password generator.

## Links <a class="anchor" id="links"></a>
[Repository](https://github.com/qbsaram/Project-Week-1-Build-Your-Own-Game)
[Presentation](https://drive.google.com/drive/folders/1p7ZHvzo3XA7Ques3pE_boC2vO8PSWCD8/)
[Notion](https://www.notion.so/b06e659559e84a0aaa4c95232c3a9da4?v=8686689b588c44b390941c270d185651)
156 changes: 156 additions & 0 deletions your-project/.ipynb_checkpoints/main-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"id": "6238cff7",
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"import string\n",
"\n",
"lower_case = str(string.ascii_lowercase)\n",
"upper_case = str(string.ascii_uppercase)\n",
"symbols = str(string.punctuation)\n",
"digits = str(string.digits)\n",
"\n",
"nbrs_length = list(range(4, 17))\n",
"requirements = []"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "85ff6962",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Please input the length of your password. The length can only be between 4 and 16 characters:14\n"
]
}
],
"source": [
"req_length = int(input(\"Please input the length of your password. The length can only be between 4 and 16 characters:\"))\n",
"\n",
"while req_length not in nbrs_length:\n",
" req_length = int(input(\"Please enter a number between 4 and 16:\"))\n",
" \n",
"#After second input, wrong answers will not be changed."
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "609d9b99",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"def req_check_add (req_char, inp_char):\n",
" \n",
" '''....'''\n",
" \n",
" while req_char != \"y\" and req_char != \"n\":\n",
" req_char = str(input(\"Please enter (y/n):\"))\n",
" \n",
" if req_char == \"y\":\n",
" requirements.append(inp_char)\n",
" \n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "fc3902cc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Do you want to include uppercase letters? (y/n):y\n",
"Do you want to include lowercase letters? (y/n):y\n",
"Do you want to include symbols? (y/n):y\n",
"Do you want to include numbers? (y/n):y\n"
]
}
],
"source": [
"while requirements == []:\n",
" req_upper = str(input(\"Do you want to include uppercase letters? (y/n):\"))\n",
" req_check_add(req_upper, upper_case)\n",
"\n",
" req_lower = str(input(\"Do you want to include lowercase letters? (y/n):\")) \n",
" req_check_add(req_lower, lower_case)\n",
"\n",
" req_symbols = str(input(\"Do you want to include symbols? (y/n):\"))\n",
" req_check_add(req_symbols, symbols)\n",
"\n",
" req_number = str(input(\"Do you want to include numbers? (y/n):\"))\n",
" req_check_add(req_number, digits)\n",
"\n",
"requirements = \"\".join(requirements)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "c5fd2cef",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"E:KQF)Z2y!@;/O\n"
]
}
],
"source": [
"\n",
"password = []\n",
"for i in range(req_length):\n",
" i = random.choice(requirements)\n",
" password.append(i)\n",
"password = \"\".join(password)\n",
" \n",
"print(password)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2f816d78",
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
34 changes: 0 additions & 34 deletions your-project/README.md

This file was deleted.

Binary file added your-project/__pycache__/config.cpython-38.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions your-project/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Function for adding the character type input and also check if it is the right input.
def req_check_add (req_char, inp_char):

'''
Checks the y/n input and adds the characters to the requirements list.
Input arguments: req_char, inp_char
Arguemnt types: String, String
Output: none
'''
requirements = []
while req_char != "y" and req_char != "n":
req_char = str(input("Please enter (y/n):"))

if req_char == "y":
requirements.append(inp_char)

#print(requirements)
return requirements

Loading