Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Function that calculates squre root, square and cube of a number
- def square_cube_root(a):
- square = a * a
- cube = square * a
- root = a ** (1/2)
- return (square, cube, root)
- # Main program that takes the number from user and calculates it's square, root and square root
- input_number = int(input("Please, input a number to find out its root, cube and square root\n\n"))
- print("\nMuch obliged!\n") # just a tribute to Bubs :)
- (square, cube, root) = square_cube_root(input_number)
- # Printing the function result
- 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