fix(curriculum): add brief explanation of strings (#62495)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
l3onhard 2025-10-06 13:54:04 +02:00 committed by GitHub
parent a389bc7364
commit 3176f36bd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,13 +16,14 @@ name = 'John Doe'
age = 25
```
In the example above, the variable `name` holds the value `'John Doe'`. This value is a string, which is a series of characters used to represent text. Strings are written with single or double quotes, for example `'Hello'` or `"Hello"`. In future lessons, you'll learn more about working with strings in Python.
When naming variables in Python, there are some important rules you should keep in mind:
- Variable names can only start with a letter or an underscore (`_`), not a number.
- Variable names can only contain alphanumeric characters (`a-z`, `A-Z`, `0-9`) and underscores (`_`).
- Variable names can only start with a letter or an underscore (`_`), not a number.
- Variable names can only contain alphanumeric characters (`a-z`, `A-Z`, `0-9`) and underscores (`_`).
- Variable names are case-sensitive — `age`, `Age`, and `AGE` are all considered unique.
- Variable names cannot be one of Python's reserved keywords such as `if`, `class`, or `def`.
If you break any of those rules, your Python program will throw a `SyntaxError`: