Engineering 102 Final Exam questions with
Complete Solutions |100% Pass
A function body can be thought of as its own, separate program, true or false? - ✔✔true
What is the output of the following code?
def myfunc():
a=3
print(a,end='')
a=7
print(a, end='')
myfunc()
print(a, end='') - ✔✔7.3.7.
What objects are mutable? - ✔✔lists and dictionaries
what objects are immutable? - ✔✔integers, floats, complex numbers, Booleans, strings, tuples
return statements can return ___ value - ✔✔only one
, special elements which allow return to be "multiple" elements - ✔✔tuples and lists
a function with no return value returns... - ✔✔"None"
def user_function(number + 5), valid or invalid? - ✔✔invalid
parameters = - ✔✔= variables
arguments = - ✔✔= values
rules for mixing keyword arguments and positional arguments (2) - ✔✔1) keyword
arguments mut follow positional arguments in their order
2) keyword arguments must come last in the order
Error Types (9) - ✔✔1) SyntaxError
2) ValueError
3) IndentationError
Complete Solutions |100% Pass
A function body can be thought of as its own, separate program, true or false? - ✔✔true
What is the output of the following code?
def myfunc():
a=3
print(a,end='')
a=7
print(a, end='')
myfunc()
print(a, end='') - ✔✔7.3.7.
What objects are mutable? - ✔✔lists and dictionaries
what objects are immutable? - ✔✔integers, floats, complex numbers, Booleans, strings, tuples
return statements can return ___ value - ✔✔only one
, special elements which allow return to be "multiple" elements - ✔✔tuples and lists
a function with no return value returns... - ✔✔"None"
def user_function(number + 5), valid or invalid? - ✔✔invalid
parameters = - ✔✔= variables
arguments = - ✔✔= values
rules for mixing keyword arguments and positional arguments (2) - ✔✔1) keyword
arguments mut follow positional arguments in their order
2) keyword arguments must come last in the order
Error Types (9) - ✔✔1) SyntaxError
2) ValueError
3) IndentationError