Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num_count =None
- account=0
- True_False=False
- all_accounts=[
- {
- "username":"viktor",
- "password":"123123",
- "date of bird":"02.10.2020",
- "male or female":"male",
- "country":"Bulgaria",
- "interests":[["obicham zelenchuci"]],
- "messege":""
- }
- ]
- def register(all_accounts):
- new_account={}
- user_name = input("username :")
- password =input("password :")
- date_of_birth = input("date of birth :")
- male_or_female = input("male or female :")
- country=input("country :")
- interests=input("interests :")
- new_account={
- "username" : user_name ,
- "password" : password ,
- "date of bird" : date_of_birth,
- "male or female" : male_or_female,
- "country":country,
- "interests":interests,
- "messege":none
- }
- all_accounts.append(new_account)
- def log_in(all_accounts,True_False,account):
- num_count=0
- username=input("username ? ")
- password=input("password ? ")
- for users in all_accounts:
- if username == all_accounts[num_count]["username"] and password == all_accounts[num_count]["password"]:
- True_False=True
- num_count+=1
- while True_False:
- answer=input("change or quit ? ")
- logged_in(all_accounts,account,answer)
- if answer =="quit":
- break
- account = num_count-1
- if True_False==False:
- print("invailid password or username !!")
- def logged_in(all_accounts,account,answer):
- if answer == "change":
- answer_2 = input("what you need to change ? ")
- if answer_2=="password":
- curr_password=input("currect password :")
- conf_curr_password=input("confirmet currect password :")
- if curr_password == all_accounts[num_count-1]["password"] and conf_curr_password == all_accounts[num_count-1]["password"]:
- new_password=input("New password :")
- all_accounts[account]["password"]=new_password
- if answer_2 =="interests":
- change_interests(all_accounts,account)
- def change_interests(all_accounts,account):
- print(all_accounts[0]["interests"])
- answer=input("add or remove interests ? ")
- if answer == "add":
- new_interests=input("New interests :")
- all_accounts[account]["interests"].append([new_interests])
- if answer == "remove" and len(all_accounts[account]["interests"])==0:
- print ("no interest to remove")
- elif answer == "remove":
- remove_interests=int(input("interest which you want to remove "))
- all_accounts[account]["interests"].remove(all_accounts[account]["interests"][remove_interests-1])
- print(all_accounts[0]["interests"])
- while True:
- answer = input ("login or register ? ")
- if answer == "register":
- register(all_accounts)
- if answer == "login":
- log_in(all_accounts,True_False,account)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement