Chapter 3 Lab

Last time you took a big step and started programming python. In this lab, you will get some practice using functions. You should be familiar with Chapter 3 before completing this assignment. Answer the questions below in one big file that your TA Marc can run as a Python script/program by using the Python launcher. You can use the print command to make the output look sensible for Marc. Name the file yourlastname.py.

Email your completed assignment (i.e., attach your script file) from your preferred class email address to marctomlinson@mail.utexas.edu.

1. Rewrite your Celsius and Fahrenheit converter from the previous assignment as functions. Instead of using raw_input, call these functions with a argument.

2. Write a function that prompts the user to enter in a Fahrenheit temperature, call the function from question 1 to convert it to Celsius, then call the other function to convert back to Fahrenheit, then print out the final result.

3. Write a function that takes a number as its argument and multiples it by 4.

4. Write a function that take a number and divides it by 2.

5. Compose the functions from questions 3 and 4 together so that the initial argument is returned as the final result as in question 2.