Я делаю курс питона начинающего, и цель состоит в том, чтобы сделать кучу словарей. and
"tests".
Have the "name" key be the name of the student (that is, lloyd's name
should be "Lloyd") and the other keys should be an empty list (We'll
fill in these lists soon!)
I did this by doing the following:
def make_dict(list_of_names):
for names in list_of_names:
names = {
"name": names,
"homework" : [],
"quizzes" : [],
"tests" : []
}
list_of_names = ["lloyd", 'alice', 'tyler']
make_dict(list_of_names)
< /code>
Почему это не работает? Должно ли это работать, и это просто область разработки кодекадемии, которая не позволяет этому работать?>
Подробнее здесь: https://stackoverflow.com/questions/504 ... ing-python
Как я могу автоматизировать создание словарей с помощью Python? ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как автоматизировать создание пользователей в vcenter с помощью Python
Anonymous » » в форуме Python - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-