Q:

Coding Investigation, finding bore radius size

I'm actually not sure how to pose this question correctly, so let me just tell you what the homework states for me...
"They have bores (that dig the tunnel) that range from 0.25 metres to 8 metres in radius that increment in size by 0.25 metres (0.25, 0.5, 0.75… 7.75, 8).

At a minimum, your application will:
-Ask the user for the minimum required volume of the tunnel
-Ask the user for the exact length of the tunnel
-Use a loop to determine the bore-size required as well as the exact                   volume that would be produced with that bore.

For extra credit:

-Tell the user to extend the tunnel if the bore size required is greater than 8m.
-Allow the user to determine the volume of the tunnel with a given bore size and tunnel length
-Allow the user to determine the length of the tunnel with a given bore size and volume (in case the user would prefer to get an exact
  volume but is flexible with the tunnel length.)
-Provide the user with a list of alternatively shaped prisms (and their dimensions) that could fit the volume and length requirements."

I've tried this but it doesn't look correct;
from math import sqrt

a = float(input("What is the minimum volume that is required? (cubic metres): "))

b = float(input("How long do you need the tunnel to be? (metres): "))

pi = 3.14

r = sqrt(a/pi/b)

c = round(r, 2)

print(c)

For an input of a=250 and b=12 It provides an output of 2.58 when the answer is (supposedly) meant to be 2.75
I'm wondering, how do you round 2.58 to 2.75, and if you have the time, any ideas/help/hints on how to do the extra functionality part?

A:

You can use a loop to check which is the first element that is above a certain value, and stop once you've reached it. Generally speaking, it should be something like this:
minimum_bore_size = 0.25
bore_size_step = 0.25
maximum_bore_size = 8

required_bore_size = math.sqrt(a / b / math.pi)

if required_bore_size > maximum_bore_size:
    print ('required bore size too big')
    # exit your program somehow

bore_size = minimum_bore_size
while bore_size < maximum_bore_size:
    if bore_size < required_bore_size:
        bore_size = bore_size + bore_size_step
    else:
        volume = math.pow(bore_size,2) * math.pi * b
        print(round(bore_size,2))
        print(volume)
        break

