The end result of this is to allow a user to log in and/or register themselves for a dice game. Please post some suggestions for improvement.

import pickle

logged_in = False

with open('users.pickle', 'rb') as a_file:

print("access granted")
logged_in = True

else:

with open("users.pickle", 'wb') as f:
pickle.dump(users, f, pickle.HIGHEST_PROTOCOL)


You are introducing this requirement of not having a password being the same as a username, but the problem is the way you check for it:

create_password = input("enter a new password (Your password cannot be the same as your username !!!!!!!): ")


I think you meant to just compare create_username with create_password values.