'Python - Making a program to read a text file of usernames and passwords for authentication

I have a .txt in which stores the username and password.
Jane:1234

I have gotten to the point of reading from the file and storing them. I then need to get the users input to enter a username and password and authenticate if it is correct.



Solution 1:[1]

you can use .replace and .split

account_info = "username:password"
account_info_array = account_info.replace(":", " ").split()

['username', 'password']

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 charlie brasso