Вы должны поместить условие if accountmanagement == 2:
внутрь, пока l oop.
print("Hello Player 1, you need an account to play Dice!")
print("1: Login to your account")
print("2: Create an account")
accountmanagement = int(input())
print("\n")
incorrect_credentials1= True
while incorrect_credentials1:
if accountmanagement == 1:
username1=input("Please enter your username: ")
password1=input("Please enter your password: ")
with open('Login.txt') as f:
if username1 +","+ password1 in f.read():
print("Logged In")
incorrect_credentials1=False
else:
print("Incorrect username or password")
incorrect_credentials1=True
if accountmanagement == 2:
newusername1 = input("Please enter your name: ")
newpassword1 = input("Excellent! Now let's create a password: ")
file = open("Login.txt","a")
file.write (newusername1)
file.write (",")
file.write (newpassword1)
file.write("\n")
file.close()
incorrect_credentials1=False
else:
print("Incorrect option selected.)
incorrect_credentials1 = False
Ваш отступ для условия 2nd if
был снаружи, пока l oop. Просто сделайте это внутри, и вы хороши для go.