Skip to content

Instantly share code, notes, and snippets.

@evwltrs
Created February 12, 2019 14:25
Show Gist options
  • Save evwltrs/e41ee76e89667e91901c24cef9bc5a05 to your computer and use it in GitHub Desktop.
Save evwltrs/e41ee76e89667e91901c24cef9bc5a05 to your computer and use it in GitHub Desktop.
# import only system from os
from os import system, name
# import sleep to show output for some time period
from time import sleep
# define our clear function
def clear():
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
_ = system('clear')
passwordset = input('What password do you want to set? ')
print(f'Set password to {passwordset}')
sleep(2)
clear()
password = input('Enter your password: ')
if (password == passwordset):
print('Access Granted')
else:
print('Try again')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment