Advertisement
Guest User

pset2.py

a guest
Jan 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. def print_hello(name):
  2.     print("Hello", name)
  3.  
  4.  
  5. def get_numbers():
  6.     x = int(input("Enter first integer: "))
  7.     y = int(input("Enter second integer: "))
  8.     return x + y
  9.  
  10.  
  11. def cube(x):
  12.     return x ** 3
  13.  
  14.  
  15. def get_hypotenuse(a, b):
  16.     return ((a ** 2) + (b ** 2)) ** 0.5
  17.  
  18.  
  19. def find_distance(x1, y1, x2, y2):
  20.     return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
  21.  
  22.  
  23. def find_triangle_perimeter(x1, y1, x2, y2, x3, y3):
  24.     return (find_distance(x1, y1, x2, y2) +
  25.     find_distance(x1, y1, x3, y3) + find_distance(x2, y2, x3, y3))
  26.  
  27.  
  28. def do_math(x, y):
  29.     return (((3 * x ** 2) + (4 * y)) / (2 * x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement