A driveway up a hill has a slope of 1:9. We travel a horizontal distance of 300m

a) What is the ascend (in m)?
b) What is the corresponding distance measured along the way?
If the slope is 1:9, the ascend is $\frac{1}{9}th$ of the horizontal distance.
For the distance along the way, we use Pythagoras:
$ \begin{align*} & way = \sqrt{distance^2 + ascend^2} \end{align*} $
# Calculations
import numpy as np
distance = 300
ascend = 1/9 * distance
print(f'The the ascend is {ascend:.0f} m')
way = np.sqrt(distance**2 + ascend**2)
print(f'The length of the way is {way:.0f} m')