How to create the function is_burger(breads) that determines whether a stack of bread is a
Input : a non-empty list of strings breads that represents the bread stack you are checking; the possible strings
are: 'ob', 'cb', 'ow', 'cw', 'or', 'cr'.
Output : a boolean, True if the bread stack is a burger; otherwise False . A bread stack is a burger if each
open piece of bread is followed by a matching closed piece of bread, and there is either nothing between
the opening and closing bread, or there is one or more burgers between the opening and closing bread.
Note: For a bread stack to be a burger it must follow two rules: first, any open piece of bread must be followed
by a matching closing piece of bread; second, any open-close pair may contain a stack of bread between them,
provided the stack is also a burger. There are three different kinds of bread: brioche (open brioche is 'ob' ,
closed is 'cb' ), wholemeal ('ow' , 'cw' ), and rye ('or' , 'cr' ).
Recently Asked Questions
- I din't know what has happened to my coding (it says that it is EOFErrors), could anyone help me with it? And could anyone teaches me another ways to finish
- Need help with responding to this Question This week you will learn about basic code structure. The term structure, as it relates to programming, refers to the
- Python: Given the sequence of numbers 1 through 15, what would be the order of insertion of these numbers into a binary search tree that would result in a