IT 116: Introduction to Scripting
Answers to Class 11 Ungraded Quiz
If you were calculating a running total, which would be stored in a variable named
total, what value would you assign to this variable
at the start of the program?
0
What is the augmented assignment operator that adds the value on its right
to the value of the variable on its left and assigns that new value to the variable?
+=
What is the augmented assignment operator that subtracts the value on its right
from the value of the variable on its left and assigns that new value to the variable?
-=
What is the augmented assignment operator that multiples the value on its right
by the value of the variable on its left and assigns that new value to the variable?
*=
What is the augmented assignment operator that performs regular division on the value of the variable
to its left by the value on its right and assigns that new value to the variable?
/=
What is the augmented assignment operator that performs integer division of the
value of the variable on its left by the value on its right and assigns that
new value to the variable?
//=
Write a function header for function named max that takes two integers
as parameters.
def max(num1, num2):
Write an assignment statement that uses a function call to the function max,
which takes two arguments, to give a value to the variable maximum.
Use the values 5 and 10 in the
function call.
maximum = max(5, 10)
What is a void function?
a function that does not return a value
What do you call the functions that are always available in Python
and DO NOT have to be imported?