You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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.
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:
I found myself explaining the # comments here, though they are explained a little further down in this section:
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!
The text was updated successfully, but these errors were encountered: