More list manipulation.

This commit is contained in:
Josh Mudge 2019-02-05 19:38:29 -07:00
parent a6e32a2296
commit d67e98aee7
1 changed files with 20 additions and 0 deletions

View File

@ -319,6 +319,26 @@ print(cubes)
```
cuts_under_30 = [hairstyles[i] for i in range(0, (len(hairstyles) - 1)) if new_prices[i] < 30]
```
### Another example
```
[lst.append("hi, " + name)]
```
## Make sure starting number is uneven
```
def delete_starting_evens(lst):
while len(lst) > 0 and lst[0] % 2 == 0:
lst.remove(lst[0])
return lst
#Uncomment the lines below when your function is done
print(delete_starting_evens([4, 8, 10, 11, 12, 15]))
print(delete_starting_evens([4, 8, 10]))
```
## Ranges
You can get a range of numbers using `range()`