Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random password generator on python #2121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
31 changes: 31 additions & 0 deletions magic-8-ball.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import random
import time

def magic_8_ball():
answers = [
"Yes",
"No",
"Ask again later",
"Cannot predict now",
"Don't count on it",
"Most likely",
"Outlook not so good",
"Reply hazy, try again"
]

print("Welcome to the Magic 8-Ball!")
time.sleep(1)

while True:
question = input("Ask me a yes-or-no question (or type 'exit' to end): ")
if question.lower() == 'exit':
print("Goodbye!")
break

print("Shaking the Magic 8-Ball...")
time.sleep(2)
answer = random.choice(answers)
print(f"The Magic 8-Ball says: {answer}\n")

if __name__ == "__main__":
magic_8_ball()
12 changes: 12 additions & 0 deletions random pass generator .py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import random
import string

def generate_password(length=12):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password

if __name__ == "__main__":
password_length = int(input("Enter the desired password length: "))
generated_password = generate_password(password_length)
print("Your generated password is:", generated_password)
113 changes: 0 additions & 113 deletions requirements.txt

This file was deleted.

113 changes: 0 additions & 113 deletions requirements_with_versions.txt

This file was deleted.