Skip to content

per #619 add callout for variable naming best prax #624

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions episodes/01-short-introduction-to-Python.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ The variable `text` is of type `str`, short for "string". Strings hold
sequences of characters, which can be letters, numbers, punctuation
or more exotic forms of text (even emoji!).

::::::::::::::::::::::::::::::::::::::::: 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
:::::::::::::::::::::::::::::::::::::::::

We can also see the value of something using another built-in function, `print`:

```python
Expand Down