Worksheetsiav ML Study Group Pop Quiz 3
Total questions: 15
Worksheet time: 30mins
Python was created by...
Guido van Rossum
Larry Wall
Ada Lovelace
Dennis Ritchie
The latest DEVELOPMENT version of Python is...
(a)
a=3
b=5
a=b
a=?
3
5
The first work on Python was done in the year:
1989
1991
1965
2004
Which of the following Python data structures are IMMUTABLE?
Strings
Lists
Sets
Dictionaries
Tuples
def foo_function (billvar,bobvar):
In the example function above, "billvar" and "bobvar" are:
Arguments
Constructs
Strings
Hyperparameters
Python if statements allow for the keywords "if", "else" and:
(a)
I have a numeric variable, x, and I want to CUBE it (raise it to the power of 3). What is the built-in operation for this in Python?
x=x*x*x
x=x^3
x=x**3
x=numpy.cube(x)
Write the boolean expression for "x not equal to y"
(a)
antique_coins = ['obol', 'denarius', 'rouble', 'shekel', 'daric', 'cash', 'dirham', 'nummus']
Given the list of antique coins above, write a list comprehension which will create a new list called s_coins which will only include coins which contain the letter 's' in their names.
This question is ungraded! Please save your answer for discussion later.
Python is a(n) _______ language.
interpreted
compiled
pre-compiled
ROM-encoded
abstract
What is the difference between a single quote mark ' and a double quote mark " in python?
Single quotes are for strings, double quotes are for regular expressions
Trick question: Python does not distinguish between single and double quotes.
Single quotes are allowed, double quotes will cause an unreadable sigil error
Single quotes use less RAM as they are half as complex to represent
Which of the following is NOT a default numeric type in Python?
int, integers
float, floating-point numbers
complex, imaginary numbers
UInt128, unsigned 128-bit integers
"Docstrings" in Python are:
A string which occurs in the first statement of a module, which can then be accessed by calling the __doc__ attribute of that module.
A special type of string which can only be used to write documentation
Trick question: Docstrings do not exist in Python
Simply another name for the normal string type
If you have to create several different projects, using several different point versions of Python and its packages, it would be easiest to organize them with:
venvs, Virtual Environments
penvs, Prototyping Environments
denvs, Development Environments
xenvs, eXtensible Environments
grenvs, Gruesome Environments
