Open Sathyan2001 opened 1 year ago
print("Welcome to my computer quiz!")
playing = input("Do you want to play? ")
if playing.lower() != "yes": quit()
print("Okay Let's Play :)") score = 0
answer = input("What does GPU stands for? ") if answer.lower() == "graphics processing unit": print('Correct!') score += 1 else: print("Incorrect")
answer = input("What does RAM stands for? ") if answer.lower() == "random access memory": print('Correct!') score += 1 else: print("Incorrect")
answer = input("What does PSU stands for? ") if answer.lower() == "power supply unit": print('Correct!') score += 1 else: print("Incorrect")
answer = input("What does CPU stands for? ") if answer.lower() == "central processing unit": print('Correct!') score += 1 else: print("Incorrect")
print("You got " + str(score) + "quesions are correct!")
print("You got " + str((score / 4) * 100) + "%.")
project outputs.docx
import random import string
def generate_password(min_length, numbers=True, special_characters=True): letters = string.ascii_letters digits = string.digits special = string.punctuation
min_lenght = int(input("Enter the minimum length: ")) has_number = input("Do u want to have numbers (y/n)?").lower() =="y" has_special = input("Do you want to have special characters (y/n)").lower() =="y" pwd = generate_password(min_lenght, has_number, has_special) print("The generated password is:", pwd)