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

Introduction of # comments in E2 #485

Open
jeffdotg opened this issue Feb 1, 2021 · 1 comment
Open

Introduction of # comments in E2 #485

jeffdotg opened this issue Feb 1, 2021 · 1 comment
Labels
good first issue Good issue for first-time contributors

Comments

@jeffdotg
Copy link

jeffdotg commented Feb 1, 2021

I recently taught a demo of Episode 2: Short Introduction to Programming in Python
https://datacarpentry.org/python-ecology-lesson/01-short-introduction-to-Python/index.html

Under Introduction to Python built-in data types, comments are introduced but not yet explained:

Python
text = "Data Carpentry"  # An example of a string
number = 42  # An example of an integer
pi_value = 3.1415  # An example of a float

I found myself explaining the # comments here, though they are explained a little further down in this section:

Python:
# A Python script file
# Comments in Python start with #
# The next line assigns the string "Data Carpentry" to the variable "text".
text = "Data Carpentry"

# The next line does nothing!
text

# The next line uses the print function to print out the value we assigned to "text"
print(text)

I was wondering if it may make sense to pull out some of the explanation and move to where comments are first introduced? Perhaps even just # Comments in Python start with # and leave the rest, as it makes sense with the script discussion?

Thanks!

@maxim-belkin
Copy link
Contributor

Hi, Jeff!

What you suggest makes sense to me. Would you be willing to open a PR to implement this change?

Maxim

maxim-belkin added a commit to maxim-belkin/python-ecology-lesson that referenced this issue Mar 15, 2021
To avoid problems with various symbols, we have to specify the encoding
when we read files.
The actual codec name is `utf_8` but aliases like `utf8`, `utf-8`, etc
are accepted. Here, I'm using `utf-8` alias.
https://docs.python.org/3.8/library/codecs.html#standard-encodings

This fixes `make lesson-check` when running under 'Git for Windows' for
lessons that have non-cp1252 characters.
@quist00 quist00 added the good first issue Good issue for first-time contributors label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good issue for first-time contributors
Projects
None yet
Development

No branches or pull requests

3 participants