Skip to content

PYTHON-SECURITY ACCESS #558

@mohamedarshan786-hub

Description

@mohamedarshan786-hub

I AM A BEGINNER TO PYTHON AND THIS IS MY FIRST CODE IN PYTHON AFTER HEARING SO MANY TUTORIAL VIDEOS FROM YOUTUBE.https://youtu.be/kqtD5dpn9C8


import sys
import time

secret_code = "2468"   # change your secret code here
attempts = 0
max_attempts = 3

while attempts < max_attempts:
    entered = input("Enter the secret code: ")

    if entered == secret_code:
        print("Access Granted! ✅🔰🈯️🔰✅🔰")
        sys.exit()  # stop program completely
    else:
        print("Incorrect")
        attempts += 1
        
        if attempts == 2:
            print("Hint: It's an even number sequence.")

# First lock: 1 minute
print("⚠️🚫⚠️🚫⚠️🚫⚠️  Access Locked for 1 minute!")
time.sleep(60)

# One try after 1 minute
entered = input("Try again after 1 min (Hint: It's an even number sequence): ")

if entered == secret_code:
    print("Access Granted! ✅🔰✅🔰")
    sys.exit()
else:
    print("Incorrect again!")
    print("⚠️🚫⚠️🚫⚠️🚫⚠️  Access Locked for 5 minutes!")
    time.sleep(300)  # 5 minutes lock

# Last try after 5 minutes
entered = input("Final try after 5 min (Hint: It's an even number sequence): ")

if entered == secret_code:
    print("Access Granted! ✅🔰✅🔰")
else:
    print("⚠️🚫⚠️🚫⚠️🚫⚠️  ACCESS PERMANENTLY LOCKED!")
sys.exit()
 

AND GUYS I AM NOT THAT PRO SO IF ANY PROBLEMS PLS DM ME

AND I DON'T KNOW SHOULD WE POST OUR PROJECT HERE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions