Skip to content

Episode 01 - adding variable naming conventions, defining keywords #619

Open

Description

@eug-xu

How could the content be improved?

One issue that I ran into teaching Episode 1 was that learners were running into problems with variable naming. Learners weren't being taught that variable names could not include spaces in between, cannot be titled keywords, cannot use certain punctuation, & also that variables were case sensitive. The Programming with Python Python Fundamentals episode includes bullet points that go over all of these issues, I'd migrate that information here under the Variables section

Which part of the content does your suggestion apply to?

https://datacarpentry.github.io/python-ecology-lesson/01-short-introduction-to-Python.html

Activity

  1. self-assigned this
    on Mar 19, 2025
  2. added
    type:enhancement
    type:clarification
    on Mar 19, 2025
  3. carlosmr12 commented on Mar 19, 2025

    @carlosmr12
    Contributor

    Hi @eug-xu, thank you for your suggestion.

    I agree, we could potentially have one of those "reminder boxes" (I believe they are called "callouts") to clarify that point. Perhaps with the same wording from the Programming with Python Fundamentals lesson you mentioned:

    :::::::::::::::::::::::::::::::::::::::::  callout
    
    ## In Python, variable names:
    - can include letters, digits, and underscores-
    - cannot start with a digit
    - are [case sensitive](https://carpentries-incubator.github.io/python-novice-programming-gapminder/reference.html#case-sensitive).
    
    This means that, for example:
    - gdpPercap0 is a valid variable name, whereas 0gdpPercap is not
    - gdp_percap and GDP_percap are different variables
    

    I believe it would look good if it was placed right after the output box displaying "Data Carpentry".

    What do you think? Would you want to give a try at submitting a PR for this?

  4. jas58 commented on May 21, 2025

    @jas58

    This is especially important as the students skipped Shell/Unix/Bash and Git (version control) so have not had file naming best practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type:clarificationtype:enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions