Computer Studies‎ > ‎Python‎ > ‎Python Tutorial‎ > ‎

Math II Assignments

Assignment

Refer to Math Functions in Python. You must use functions from this page for these assignments.

Write a program that prompts for a number, then outputs five plain-languages mathematical statements about that number such as:

The floor value of 1.234 is 1.0
The square root of 1.234 is 1.11085552616

Save as "Math1.py". (Get this assignment approved before doing the next assignment.)

Assignment

Modify the previous program so it now includes checking for illegal entries for the functions you have chosen (choose at least one function that requires error checking!). For example, you cannot take the square root of a negative number, so the appropriate output message should be similar to:

-1.234 does not have square root because it is negative.

Also, be sure the program includes at least one trigonometric function, and have its output in both radians and degrees.

Save as "Math2.py".

Comments