Drain Capping

Take your drain method from the previous exercise and prevent it from being drained below a volume of 0.

What is expected

tub = Bathtub("white", 20)
tub.drain(15)
print(tub.current_volume)  # should be 5
tub.drain(15)
print(tub.current_volume)  # should be 0, NOT -10

©2021 Daniel Gallo

This work is licensed under Attribution-NonCommercial-ShareAlike 4.0 International