mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
fix(curriculum): clarify slicing syntax (#66122)
This commit is contained in:
parent
1d11379e51
commit
58780e836a
@ -121,7 +121,7 @@ name, *rest = developer
|
||||
|
||||
- If the number of variables on the left side of the assignment operator doesn't match the total number of items in the list, then you will receive a `ValueError`.
|
||||
|
||||
- **Slicing Lists**: Slicing is the concept of accessing a portion of a list by using the slice operator `:`. To slice a list that starts at index `1` and ends at index `3`, you can use the following syntax:
|
||||
- **Slicing Lists**: Slicing is the concept of accessing a portion of a list by using the slice operator `:`. To slice a list that starts at index `1` and ends before index `3`, you can use the following syntax:
|
||||
|
||||
```python
|
||||
desserts = ['Cake', 'Cookies', 'Ice Cream', 'Pie']
|
||||
|
||||
@ -959,7 +959,7 @@ name, *rest = developer
|
||||
|
||||
- If the number of variables on the left side of the assignment operator doesn't match the total number of items in the list, then you will receive a `ValueError`.
|
||||
|
||||
- **Slicing Lists**: Slicing is the concept of accessing a portion of a list by using the slice operator `:`. To slice a list that starts at index `1` and ends at index `3`, you can use the following syntax:
|
||||
- **Slicing Lists**: Slicing is the concept of accessing a portion of a list by using the slice operator `:`. To slice a list that starts at index `1` and ends before index `3`, you can use the following syntax:
|
||||
|
||||
```python
|
||||
desserts = ['Cake', 'Cookies', 'Ice Cream', 'Pie']
|
||||
|
||||
Loading…
Reference in New Issue
Block a user