Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Pipeline #10134 passed
...@@ -3,6 +3,17 @@ import math ...@@ -3,6 +3,17 @@ import math
def vol_of_sphere(radius): def vol_of_sphere(radius):
""" """
compute the volume of sphere of a given radius compute the volume of sphere of a given radius
work only in python3
"""
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) vol = float(4) / float(3) * float(math.pi) * pow(radius, 3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment