When building an enclosure for a python the amount of area at the base of the enclosure should be proportionate to the length of the snake. The minimum needed is 1/2 square foot for each foot in length up to and including 6 and 3/4 square foot for each foot after that. e.g. 9' python needs 5.25 square feet (6 * ½ + 3 * ¾)
Create a program that asks the user how long their python is and tell them the minimum area they need for the base of its enclosure.
1
Expert's answer
2016-03-31T11:05:04-0400
ask = input('How long is your python: ') a = 0.0
if int(ask) <= 6: a += float(ask)*1/2 else: a += 3 a += (float(ask) - 6)*3/4
Comments
Leave a comment