Week 2 Practice Quiz Answer
Which of the following is a template that defines the shape of an object that is created?
Which of the following describes a feature which we would expect from a programming language that supported first class functions?
- The ability to return a value from a function
- The ability for a function not to return a value (i.e. void functions)
- The ability to define a function and assign the function to a variable
- The ability to omit parameters and have the omitted parameters default to a value
- The ability to have a variable number of parameters when calling a function
- data.stuff = “hello”;
- data[‘stuff’] = “hello”;
- The first statement creates an object and the second creates a dictionary
- These two statements accomplish the same thing