Verified Commit 5d61e04a authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

🎨 use python3 syntax

add othre version working with python2
parent 119061f9
Pipeline #10134 passed with stages
in 22 seconds
......@@ -3,7 +3,18 @@ import math
def vol_of_sphere(radius):
"""
compute the volume of sphere of a given radius
work only in python3
"""
vol = float(4)/float(3) * float(math.pi) * pow(radius, 3)
vol = 4 / 3 * math.pi * pow(radius, 3)
return vol
def vol_of_sphere_python2(radius):
"""
compute the volume of sphere of a given radius
work with python2 and 3
"""
vol = float(4) / float(3) * float(math.pi) * pow(radius, 3)
return vol
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment