Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- Base = 'Base.data'
- humans = {}
- def create_human(name, email):
- humans[name] = email
- def print_email(name):
- f = open(Base, 'r')
- humans = pickle.load(f)
- print(humans[name])
- f.close()
- def delete_user(name):
- f = open(Base, 'wb')
- lines = f.readlines()
- del lines[name]
- f.close()
- def foo(name):
- f = open(Base, 'rb')
- humans = pickle.load(f)
- if name in lines:
- print('Такой человек есть.')
- else:
- print('Такого человека нет.')
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement