Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Part of the code that is actually python is what I've done so far but for the most part I really need help and it's extremely urgent and any kind of help is appreciated.

def import_and_create_accounts(filename):

# your code here
initiate user_accounts dictionary
initiate log_in dictionary
user = open('user.txt','r')

for line in user
if '-' not in line
continue

username = get the username from the file
password = get the password from the file

if no username
continue
if no password
continue
signup(user_accounts, log_in, username, password)

return user_accounts,log_in

What I have tried:

Part of the code that is actually python is what I've done so far but for the most part I really need help and it's extremely urgent and any kind of help is appreciated.
Posted
Updated 31-Dec-21 5:12am
Comments
CHill60 31-Dec-21 11:09am    
I guess "extremely urgent" means you have to submit this homework before the end of year. We won't do your homework for you - it doesn't do you any favours. Putting "urgent" in your question is a sure-fire way to get it not answered - we're volunteers here, nothing here is urgent.
Incidentally - there is no python here - python requires indentation and there is none

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
No, it's not "extremely urgent".

To "convert" this code, you have to understand what your pseudo-code is talking about and know how to write Python to do what it says.

The first part of your pseudo-code is simple. Just read a text file to see if a username and password combination exists in it.


And before you ask, no, we're not writing your code for you. This is YOUR homework assignment, not ours.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900