mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-07 03:07:46 +08:00
Travis CI: Add a flake8 test for unused imports (#1038)
This commit is contained in:
@ -6,8 +6,6 @@ Wikipedia reference: https://en.wikipedia.org/wiki/Volume
|
||||
|
||||
from math import pi
|
||||
|
||||
PI = pi
|
||||
|
||||
|
||||
def vol_cube(side_length):
|
||||
"""Calculate the Volume of a Cube."""
|
||||
@ -39,9 +37,7 @@ def vol_right_circ_cone(radius, height):
|
||||
volume = (1/3) * pi * radius^2 * height
|
||||
"""
|
||||
|
||||
import math
|
||||
|
||||
return (float(1) / 3) * PI * (radius ** 2) * height
|
||||
return (float(1) / 3) * pi * (radius ** 2) * height
|
||||
|
||||
|
||||
def vol_prism(area_of_base, height):
|
||||
@ -71,7 +67,7 @@ def vol_sphere(radius):
|
||||
V = (4/3) * pi * r^3
|
||||
Wikipedia reference: https://en.wikipedia.org/wiki/Sphere
|
||||
"""
|
||||
return (float(4) / 3) * PI * radius ** 3
|
||||
return (float(4) / 3) * pi * radius ** 3
|
||||
|
||||
|
||||
def vol_circular_cylinder(radius, height):
|
||||
@ -80,7 +76,7 @@ def vol_circular_cylinder(radius, height):
|
||||
Wikipedia reference: https://en.wikipedia.org/wiki/Cylinder
|
||||
volume = pi * radius^2 * height
|
||||
"""
|
||||
return PI * radius ** 2 * height
|
||||
return pi * radius ** 2 * height
|
||||
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user