Skip to content
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

Replace print_date function in episode 16 question #546

Merged
merged 2 commits into from
Jun 4, 2021
Merged

Replace print_date function in episode 16 question #546

merged 2 commits into from
Jun 4, 2021

Conversation

perlman
Copy link
Contributor

@perlman perlman commented Apr 27, 2021

As noted in #538, the function print_date was previously used in the episode, leading to a student to potentially fail to experience the expected error if they type the code into their current python session.

This updated question will use print_time instead. This is a very simple substitution which I should be as accessible as print_date.

As suggested in #538, the function print_date was previously defined.
This updated question will use print_time instead.
Copy link
Member

@alee alee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR! I've added a few minor comments to be fixed and then I think this will be ready to merge.

>
> def print_date(year, month, day):
> joined = str(year) + '/' + str(month) + '/' + str(day)
> def print_date(hour, minute, second):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be renamed to print_time as well?

@@ -203,26 +203,26 @@ result of call is: None
> 1. What's wrong in this example?
>
> ~~~
> result = print_date(1871,3,19)
> result = print_time(11,37,59)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add spaces between the arguments here (and everywhere else that is missing them) for PEP8 compliance (and consistency with the rest of the lesson code snippets).

> print(joined)
> ~~~
> {: .language-python}
>
> 2. After fixing the problem above, explain why running this example code:
>
> ~~~
> result = print_date(1871, 3, 19)
> result = print_time(11,37,59)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need spaces here as well 😅

@alee alee linked an issue Jun 4, 2021 that may be closed by this pull request
@alee alee merged commit 03cc835 into swcarpentry:gh-pages Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In 16-writing-functions, print_date example needs revising
2 participants