Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. # Function that calculates squre root, square and cube of a number
  2.  
  3. def square_cube_root(a):
  4. square = a * a
  5. cube = square * a
  6. root = a ** (1/2)
  7. return (square, cube, root)
  8.  
  9. # Main program that takes the number from user and calculates it's square, root and square root
  10.  
  11. input_number = int(input("Please, input a number to find out its root, cube and square root\n\n"))
  12. print("\nMuch obliged!\n") # just a tribute to Bubs :)
  13. (square, cube, root) = square_cube_root(input_number)
  14.  
  15. # Printing the function result
  16.  
  17. print("Squre, cube and square root of %d, are:\n %f, %f, %f - respectively." % (input_number, square, cube, root))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement