datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists
https://datacarpentry.org/python-ecology-lesson
Other
162 stars 307 forks source link

Introduction of # comments in E2 #485

Open jeffdotg opened 3 years ago

jeffdotg commented 3 years ago

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 commented 3 years ago

Hi, Jeff!

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

Maxim