0% found this document useful (0 votes)
2 views2 pages

Python Projects PasswordLocker WikiMarkup

The document contains two Python project examples: a Password Locker that allows users to add and view passwords for different accounts, and a tool for converting plain text lines into wiki markup with bullet points. Each project includes a main function to handle user input and execute the respective functionalities. The code is structured with functions to manage tasks efficiently.

Uploaded by

sanskargurav1942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python Projects PasswordLocker WikiMarkup

The document contains two Python project examples: a Password Locker that allows users to add and view passwords for different accounts, and a tool for converting plain text lines into wiki markup with bullet points. Each project includes a main function to handle user input and execute the respective functionalities. The code is structured with functions to manage tasks efficiently.

Uploaded by

sanskargurav1942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Projects

1. PROJECT: Password Locker


# Project 1: Password Locker

passwords = {}

def add_password(account, password):


passwords[account] = password
print(f"Password for {account} added.")

def view_password(account):
if account in passwords:
print(f"{account}: {passwords[account]}")
else:
print("Account not found.")

def main():
while True:
print("\n1. Add Password\n2. View Password\n3. Exit")
choice = input("Choose an option: ")

if choice == "1":
acc = input("Enter account name: ")
pwd = input("Enter password: ")
add_password(acc, pwd)
elif choice == "2":
acc = input("Enter account name: ")
view_password(acc)
elif choice == "3":
break
else:
print("Invalid option!")

if __name__ == "__main__":
main()

2. PROJECT: Adding Bullets to Wiki Markup


# Project 2: Adding bullets to Wiki Markup

def add_wiki_bullets(lines):
return [f"* {line}" for line in lines]

def main():
print("Enter lines to convert to wiki bullets (type 'done' to finish):")
lines = []
while True:
line = input()
if line.lower() == 'done':
break
lines.append(line)

bullet_lines = add_wiki_bullets(lines)

print("\nWiki Markup with Bullets:")


for line in bullet_lines:
print(line)

if __name__ == "__main__":
main()

You might also like