Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import math
- from math import radius
- from math import radians
- e = math.exp(1.0)
- height = radius * math.sin(radians)
- # def area(radius):
- # temp = math.pi * radius ** 2
- # return temp
- # a more concise version
- def area(radius):
- return math.pi * radius ** 2
- # temporary variables like temp make debugging easier
- #def absolute_value(x):
- # if x < 0:
- # return -x
- # else:
- # return x
- # Since these return statement are in an alternative
- # conditional, only one will be executed.
- # It is a good idea to ensure that every possible path
- # through the program hits a return statement.
- def absolute_value(x):
- if x < 0:
- return -x
- if x > 0:
- return x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement