Предмет: Русский язык, автор: Аскии

Рассказ о факультативных занятиях по русскому языку

Ответы

Автор ответа: DashaDudina
0
Как кончаются занятия есть факультативы! Неужели это все значит быть счастливым? И зачем только нужны эти факультативы? дети хотят домой,погулять, поиграть в компьютер а тут на тебе учись! Интересно кто их вообще придумал и для чего? Ну как эти взрослые не поймут что нам скучно...? сидишь сидишь и так хочется домой тебе говорят слушай внимательно сейчас тебя спросим! Да куда это годится и пойти в факультативу мы сейчас задают много! не так не считается ли вы перехожу в другую школу или бы не буду Просто ходить на факультативы буду сваливать домой всё!
Похожие вопросы
Предмет: Информатика, автор: sasha82014
PYTHON. допоможіть, будь ласка. буду вдячна!
bank.txt
Brandon: 5
Patrick: 18.9
Brandon: xyz
Jack:

Sarah: 825
Jack : 45
Brandon: 10
James: 3.25
James: 125.62
Sarah: 2.43
Brandon: 100.5


user.txt
Brandon - brandon123ABC
Jack
Jack - jac123
Jack - jack123POU
Patrick - patrick5678
Brandon - brandon123ABCD
James - 100jamesABD
Sarah - sd896ssfJJH
Jennie - sadsaca


def import_and_create_accounts(filename):
'''
This function is used to create an user accounts dictionary and another login dictionary. The given argument is the
filename to load.
Every line in the file should be in the following format:
username - password
The key is a username and the value is a password. If the username and password fulfills the requirements,
add the username and password into the user accounts dictionary. To make sure that the password fulfills these
requirements, be sure to use the signup function that you wrote above.

For the login dictionary, the key is the username, and its value indicates whether the user is logged in, or not.
Initially, all users are not logged in.

What you will do:
- Create an empty user accounts dictionary and an empty login dictionary.
- Read in the file.
- If the username and password fulfills the requirements, adds the username and password
into the user accounts dictionary, and updates the login dictionary.
- You should also handle the following cases:
-- When the password is missing. If so, ignore that line and don't update the dictionaries.
-- When there is whitespace at the beginning or end of a line and/or between the name and password on a line. You
should trim any and all whitespace.
- Return both the user accounts dictionary and login dictionary from this function.

For example, here's how your code should handle some specific lines in the file:
The 1st line in the file has a name and password:
Brandon - brandon123ABC
Your code will process this line, and using the signup function, will add the extracted information to the
dictionaries. After it does, the dictionaries will look like this:
user_accounts = {"Brandon": "brandon123ABC"}
log_in = {"Brandon": False}

The 2nd line in the file has a name but missing password:
Jack
Your code will ignore this line. The dictionaries will still look like this:
user_accounts = {"Brandon": "brandon123ABC"}
log_in = {"Brandon": False}

The 3rd line in the file has a name and password:
Jack - jac123
Your code will process this line, and using the signup function, will not add the extracted information to the
dictionaries because the password is invalid. The dictionaries will still look like this:
user_accounts = {"Brandon": "brandon123ABC"}
log_in = {"Brandon": False}

The 4th line in the file has a name and password:
Jack - jack123POU
Your code will process this line, and using the signup function, will add the extracted information to the
dictionaries. After it does, the dictionaries will look like this:
user_accounts = {"Brandon": "brandon123ABC, "Jack": "jack123POU"}
log_in = {"Brandon": False, "Jack": False}

After processing every line in the file, the dictionaries will look like this:
user_accounts = {"Brandon": "brandon123ABC, "Jack": "jack123POU", "James": "100jamesABD", "Sarah": "sd896ssfJJH"}
log_in = {"Brandon": False, "Jack": False, "James": False, "Sarah": False}
Return the dictionaries from this function.
'''
#your code here
Предмет: Английский язык, автор: artmoskov4enko