What is one similarity between print () and input()? - answer Print & input similarity
+ 4 pts Both generate a string output
+ 4 pts Both built-in or standard library functions
+ 4 pts Correct, other than above
+ 1 pts Attempted but mostly incorrect or too vague
+ 0 pts Completely wrong or Blank
- 2 pts Too Vague
- 1 pts Mistake
- 0.5 pts Minor mistake
Whenever the Python interpreter needs to evaluate a name(of a variable, function,
etc...), it searched for the name definition in this order:
1: __________
2: __________
3: __________ - answer Three from the following 4:
+ 1.5 pts Local
+ 1.5 pts Global
+ 1.5 pts Module Import
+ 1.5 pts Built-in
Order of Answers:
+ 1.5 pts Correct Order
+ 1 pts Partial Correct Order
Explain the differences between 'import math' and 'from math import sqrt' or 'from math
import*' - answer import math vs from math import */sqrt
+ 5 pts "Import math" and "From math import *" import all the functions/objects of the
module while "from module import sqrt" imports the specific function/object. "From math
import *" and "From math import sqrt" allow the object to be referred to without including
the module from which it was imported, which might lead to pollution of the namespace.
+ 4 pts Partially Correct. Did not correctly explain the meaning of from math import sqrt
or *
What is the main difference between print () and return? Given an example. - answer
Print vs Return
+ 2 pts Explain print
+ 2 pts Explain return
+ 2 pts Print example
+ 2 pts return example
+ 0 pts Blank