Adding Chpater 2 files (packages)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#empty
|
||||
@@ -0,0 +1,14 @@
|
||||
# advcalculator.py with sqrt,log and ln functions
|
||||
import math
|
||||
|
||||
def sqrt(x):
|
||||
"""This function takes square root of a number"""
|
||||
return math.sqrt(x)
|
||||
|
||||
def log(x):
|
||||
"""This function returns log of base 10"""
|
||||
return math.log(x,10)
|
||||
|
||||
def ln(x):
|
||||
"""This function returns log of base 2"""
|
||||
return math.log(x,2)
|
||||
Reference in New Issue
Block a user