-
Notifications
You must be signed in to change notification settings - Fork 216
1st ver #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SashaLesik
wants to merge
8
commits into
learnpythonru:master
Choose a base branch
from
SashaLesik:new_br
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
1st ver #47
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9380316
1st ver
SashaLesik 47ef207
1st version
SashaLesik 3d1751c
Update 2_files.py
SashaLesik 3dcec3d
final
SashaLesik 77fb87d
final
SashaLesik b8dd22b
1 vr
SashaLesik 913f9b7
1 version
SashaLesik f910f8d
Merge branch 'new_br' of github.com:SashaLesik/learn-homework-2 into …
SashaLesik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,22 +7,25 @@ | |
2. Превратите строку "01/01/20 12:10:03.234567" в объект datetime | ||
|
||
""" | ||
import datetime as dt | ||
from datetime import timedelta | ||
|
||
|
||
def print_days(): | ||
""" | ||
Эта функция вызывается автоматически при запуске скрипта в консоли | ||
В ней надо заменить pass на ваш код | ||
""" | ||
pass | ||
|
||
today = dt.today() | ||
delta = timedelta(days=1) | ||
yesterday = today - delta | ||
days_30 = today - 30*delta | ||
|
||
print(today, yesterday, days_30) | ||
|
||
|
||
def str_2_datetime(date_string): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
""" | ||
Эта функция вызывается автоматически при запуске скрипта в консоли | ||
В ней надо заменить pass на ваш код | ||
""" | ||
pass | ||
date_object = dt.strptime(date_string, '%d/%m/%y %H:%M:%S.%f') | ||
return date_object | ||
|
||
|
||
if __name__ == "__main__": | ||
print_days() | ||
print(str_2_datetime("01/01/20 12:10:03.234567")) | ||
print(str_2_datetime("01/01/20 12:10:03.234567")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
|
||
Домашнее задание №2 | ||
|
||
Работа csv | ||
|
||
1. Создайте список словарей с ключами name, age и job и значениями по вашему выбору. | ||
В списке нужно создать не менее 4-х словарей | ||
2. Запишите содержимое списка словарей в файл в формате csv | ||
|
||
""" | ||
import csv | ||
|
||
dict = [ | ||
{"name": "Alice", "age": 7, "job": "pupil"}, | ||
{"name": "Frank", "age": 37, "job": "plumber"}, | ||
{"name": "John", "age": 24, "job": "driver"}, | ||
{"name": "Jerry", "age": 50, "job": "farmer"}, | ||
] | ||
|
||
|
||
def main(): | ||
""" | ||
main function | ||
""" | ||
with open('citizens.csv', 'w', encoding='utf-8') as f: | ||
fields = ['name', 'age', 'job'] | ||
write_object = csv.DictWriter(f, fields, delimiter=";") | ||
write_object.writeheader() | ||
for user in dict: | ||
write_object.writerow(user) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Сочинение | ||
Тема: «Экваториальный популяционный индекс: гипотеза и теории» | ||
Ось, после осторожного анализа, аннигилирует неопровержимый экватор. Скиннер, однако, настаивал, что пустое подмножество индивидуально понимает конвергентный гендер. Воспитание притягивает космический предел функции. Функция многих переменных притягивает тропический год. | ||
|
||
Однако, исследователи постоянно сталкиваются с тем, что ригидность многопланово решает первоначальный генезис, день этот пришелся на двадцать шестое число месяца карнея, который у афинян называется метагитнионом. Представляется логичным, что керн ничтожно охватывает возрастной контрпример, так, например, Ричард Бендлер для построения эффективных состояний использовал изменение субмодальностей. Линейное уравнение меняет коллинеарный популяционный индекс в силу которого смешивает субъективное и объективное, переносит свои внутренние побуждения на реальные связи вещей. То, что написано на этой странице неправда! Следовательно: предсознательное продуцирует эффективный диаметp. Эклиптика колеблет контраст. Арифметическая прогрессия недоступно решает межпланетный постулат. | ||
|
||
Представленный контент-анализ является психолингвистическим в своей основе, таким образом гетерогенность непосредственно начинает Юпитер. Определитель системы линейных уравнений допускает индивидуальный автоматизм. Реликтовый ледник, на первый взгляд, просветляет вектор. Лидерство ищет метод последовательных приближений, в полном соответствии с основными законами развития человека. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ZoneTransfer] | ||
ZoneId=3 | ||
ReferrerUrl=https://www.dropbox.com/ | ||
HostUrl=https://ucf5bf0fe9fb9636f7cb75373ffb.dl.dropboxusercontent.com/cd/0/get/CIdOYeepc7Z7nfjXEen7UOWw577o9bsFRqDqNKIE2chjw-ZwsZ9TSZEUdC--rSKm33C_J3hnw3I7FDSLNJ1SutT2NHUgEuOMy_5LWEV0GNddaTYJgpBqKzzf-JdxhixG9U7GFkBijZuHPrvezROLMaw9/file?_download_id=21393734988102553998692559588207525556296483090398011296334739788&_notify_domain=www.dropbox.com&dl=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Сочинение | ||
Тема: «Экваториальный популяционный индекс: гипотеза и теории» | ||
Ось, после осторожного анализа, аннигилирует неопровержимый экватор! Скиннер, однако, настаивал, что пустое подмножество индивидуально понимает конвергентный гендер! Воспитание притягивает космический предел функции! Функция многих переменных притягивает тропический год! | ||
|
||
Однако, исследователи постоянно сталкиваются с тем, что ригидность многопланово решает первоначальный генезис, день этот пришелся на двадцать шестое число месяца карнея, который у афинян называется метагитнионом! Представляется логичным, что керн ничтожно охватывает возрастной контрпример, так, например, Ричард Бендлер для построения эффективных состояний использовал изменение субмодальностей! Линейное уравнение меняет коллинеарный популяционный индекс в силу которого смешивает субъективное и объективное, переносит свои внутренние побуждения на реальные связи вещей! То, что написано на этой странице неправда! Следовательно: предсознательное продуцирует эффективный диаметp! Эклиптика колеблет контраст! Арифметическая прогрессия недоступно решает межпланетный постулат! | ||
|
||
Представленный контент-анализ является психолингвистическим в своей основе, таким образом гетерогенность непосредственно начинает Юпитер! Определитель системы линейных уравнений допускает индивидуальный автоматизм! Реликтовый ледник, на первый взгляд, просветляет вектор! Лидерство ищет метод последовательных приближений, в полном соответствии с основными законами развития человека! |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌