47 Common list patterns Flashcards
how to use both .list and .join
1
Q
wha happens if you use a list in this manner-> print(list(range(1,100)))?
A
you print out # 1 to 100
2
Q
- how does .join function?
A
it joins what ou have before it to the list you beside it
3
Q
what is an example of .join?
A
new_sentence = ‘ ‘.join([‘I’, ‘like’, ‘pizza’])
prints:
I like pizza