Skip to content

Commit 5324f94

Browse files
committed
Update 050-python-basics-5.md
1 parent f763777 commit 5324f94

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

050-python-basics-5.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ Given an list of unknown length of strings stored in `args`, for each string, ta
1111
Strings are very similar to lists...
1212

1313
## Solution
14-
Python has a handy built in sort function! And, the indexes of strings can be referred to like the indexes in arrays or lists.
15-
16-
14+
The indexes of letters in a string can referred to like the indexes of items in an array or a list. The notation for this is `string[start,end,increment]`. If you leave the first part of the notation blank, the start value will default to zero. If you leave the second part blank, the end value will be the length of the string but exclusive (so think length -1), and if the increment is left blank, then it will default to 1.
15+
16+
```python
17+
s = ""
18+
for x in args:
19+
s += x[:2]
20+
21+
print s
22+
```
1723

1824
## Flag
1925
`its_string_slicing_not_pi(e)_slicing`

0 commit comments

Comments
 (0)