100%(1)1 out of 1 people found this document helpful
This preview shows page 1 out of 1 page.
The preview shows page 1 - 1 out of 1 page.
def humanPyramid(row,column):'Takes as input the row and column number of a person in a human pyramid, then returns the total weight on that persons back'if row == 0: # If row is 0, the value is 0 because there is no person in the row indicatedreturn 0elif column == 0: # If column is 0, but there is a row value, then we calculate the row weight return (64 + humanPyramid(row - 1, column)) elif row == 1 and column == 1: # First person supports no weight because there is no one on themreturn 0elif column == 1: # First in the row supports hald of the weight of the person above which is 64
End of preview. Want to read the entire page?
Upload your study docs or become a
Course Hero member to access this document
Grammatical person, total weight, column number of a person