Skip to content

Commit

Permalink
Add variable defs to cater-waiter introduction.
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyG committed Sep 24, 2024
1 parent c4925ea commit 25506de
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions exercises/concept/cater-waiter/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,27 @@ There is no operator equivalent:


```python
# Both mammals and additional_animals are lists.
>>> mammals = ['squirrel','dog','cat','cow', 'tiger', 'elephant']
>>> additional_animals = ['pangolin', 'panda', 'parrot',
'lemur', 'tiger', 'pangolin']

# Animals is a dict.
>>> animals = {'chicken': 'white',
'sparrow': 'grey',
'eagle': 'brown and white',
'albatross': 'grey and white',
'crow': 'black',
'elephant': 'grey',
'dog': 'rust',
'cow': 'black and white',
'tiger': 'orange and black',
'cat': 'grey',
'squirrel': 'black'}

# Birds is a set.
>>> birds = {'crow','sparrow','eagle','chicken', 'albatross'}

# Mammals and birds don't share any elements.
>>> birds.isdisjoint(mammals)
True
Expand Down

0 comments on commit 25506de

Please sign in to comment.