Functions
For this quiz I want you to (in class) create a program with two functions:
- def square_root(x): // returns the square root of x (float)
- def cube_root(x): // returns the cube root of x (float)
What to Do
You implement this function in your own program in a file quiz3.py.
You should make a main routine that asks the user for a number and then calls your functions to calculate the square and cube roots of that number and prints them out.
What should you do if the user enters a negative number?
Publish your code on your own blog today (during class time is best) and use the tag #Quiz03 so it shows up nicely in our tag cloud.
Feature Image Credit
Quiz Week 3 by admin is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.