Question: Please code in python: def drop ( self , item: str ) - > int: # | None: Return the row -

Please code in python: def drop(self, item: str)-> int: # | None:
"""
Return the row-coordinate of where the landed when dropped into
this column.
Dropping refers to inserting the into this column so that the
Square with the largest row-coordinate that previously had a value of
None now has as its symbol.
See the assignment materials for a diagram.
Preconditions:
- is_column(self.cells)
- not self.is_full()
- item in ('X','O')
>>> l = Line([Square((0,0)), Square((1,0)),
... Square((2,0)), Square((3,0))]) # an empty column
>>> row_coord = l.drop('X')
>>> row_coord
3
# >>> print(l[row_coord])
X
"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!