-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject1.py
23 lines (21 loc) · 1.69 KB
/
project1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
user = {'gauransh':9205768854,'sharwan':9868958402,'kiran':9968251108, #User Database using dictionary
'hitesh':9013825255}
crdentials = {'gauransh':{'email':'[email protected]','age':'16','phone':
'9205768854'}
,'sharwan':{'email':'[email protected]','age':'50','phone':'9868958402'},
'kiran':{'email':'[email protected]','age':'43','phone':'9968251108'}, #User Database using dictionary
'hitesh':{'email':'[email protected]','age':'22','phone':'9013825255'}}
inp = str(input('Enter Username : ')) #username input
if inp in user: #checking wether user exist
password_inp = int(input('Enter Password : ')) #password input
if password_inp == user[inp]: #matching password with database
print('Welcome to My Program ' + inp)
print('Your Credentials are here : ')
print('\nEmail : '+crdentials[inp]['email']) #prints emial from databse dictionary
print('Age : '+crdentials[inp]['age']) #prints age from databse dictionary
print('Phone: '+crdentials[inp]['phone']) #prints phone from databse dictionary
else:
print('Password don\'t match') #message if password entered is incorrect
exit() #exiting program after cheking
else:
print('User doesn\'t exist') #message if user is not in database