Skip to content

Commit e8758e7

Browse files
authored
per #619 add callout for variable naming best prax
tried to drop callout box in there, but it's a busy page full of call outs and tips already. Might need to nest somewhere else for clarity. per suggestion in #619
1 parent d10c9fc commit e8758e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

episodes/01-short-introduction-to-Python.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ The variable `text` is of type `str`, short for "string". Strings hold
125125
sequences of characters, which can be letters, numbers, punctuation
126126
or more exotic forms of text (even emoji!).
127127

128+
::::::::::::::::::::::::::::::::::::::::: callout
129+
130+
## In Python, variable names:
131+
- can include letters, digits, and underscores-
132+
- cannot start with a digit
133+
- are [case sensitive](https://carpentries-incubator.github.io/python-novice-programming-gapminder/reference.html#case-sensitive).
134+
135+
This means that, for example:
136+
- gdpPercap0 is a valid variable name, whereas 0gdpPercap is not
137+
- gdp_percap and GDP_percap are different variables
138+
:::::::::::::::::::::::::::::::::::::::::
139+
128140
We can also see the value of something using another built-in function, `print`:
129141

130142
```python

0 commit comments

Comments
 (0)