HTTLACS: Ch 3 Exercises
From WLCS
Directions:
- Open a new Google Drive document
- Put your name at the top
- Title the document as YOURLASTNAME_ch3
- Complete the exercises below in this file. If you use WingIDE, then be sure to copy & paste your code into the Google Doc
- Be sure to number each of your answers!!
References:
Exercises:
- Define the term: function definition
- Where are all function definitions supposed to be placed?
- Define the term: function header
- Define the term: function body
- What does a function call do?
- Define a function named new_line() that prints out an empty line. Test it out with a function call to new_line()
- Define a function named printHighFive() that prints out "High five!" 5 times. Test it out with a function call to printHighFive().
- Define a function named print25High() that calls printHighFive() 5 times so that "High five" is shown 25 times. Test it out with a function call to print25High()
- Define the term: parameter
- What is the parameter in the following function header? def f(x):
- Complete the function body for def f(x): so that the cube of x is printed out (HINT: x to the power of 3)
Submit:
- Submit to Mr. Bui via Google Classroom