forked from Ranit-Bandyopadhyay/Music-recommendation-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstt.py
63 lines (48 loc) · 2.03 KB
/
stt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# LOGIN PAGE
''' WELCOME TO THE MUSIC RECOMMENDATION SYSTEM. ENTER A MUSIC AND GET SIMILAR RECOMMENDATIONS
SO LET'S GO!!!!!!!!!!!!
'''
print(' WELCOME TO MUSIC RECOMMENDATION SYSTEM ')
print('---------------------------------------------------------------------------------------------------------------------------')
password = []
username = []
i = 0
def enter_info(x):
global i
y = x.split(' ')
password.append(y[-1])
username.append(y[0])
for i in range(len(password)):
for j in range(i + 1, len(password)):
if (password[i] == password[j]):
try:
while (password[i] == password[j]):
print('enter again, same password')
password.remove(password[i])
password.append(input('password'))
if (password[i] != password[j]):
break
i += 1
except IndexError:
print('logged out!')
print('choose another password or your info can be stolen')
return;
print('logged in as {}!'.format(y[0]))
return ;
t = int(input('enter number of users'))
for i in range(t):
enter_info(input('username and password with a space'))
print()
def reveal_info():
for i in range(t):
for j in range(i + 1, t):
if (password[i] == password[j]):
password.remove(password[j])
print('yes')
print('-' * 46)
print('Username |password')
print('-' * 46)
for i, j in zip(username, password):
print(i + ' '*(18-len(i)) + '|' + j)
print('-' * 46)
#reveal_info()