DSCI quiz 1
Multiline strings are enclosed either in or in .
""" (triple double quotes) or ''' (triple single quotes).
The raw string r'\\Hi!\\' represents the regular string .
'\\\\Hi!\\\\'
Design patterns
Proven architectures for constructing flexible and maintainable object-oriented software.
To display all numeric values with their sign, use a(n) in the format specifier; to display a space rather than a sign for positive values use a(n) instead.
+, space character.
condition
Boolean expression with the value True or False
(TRUE/FALSE) The following are valid variable names: 3g, 87 and score_4.
False. Because they begin with a digit, 3g and 87 are invalid names.
(TRUE/FALSE) If you do not specify the alignment, all values displayed in a field are right aligned by default.
False. Only numeric values are right aligned by default
(TRUE/FALSE) Python treats y and Y as the same identifier.
False. Python is case sensitive, so y and Y are different identifiers.
(TRUE/FALSE) String method find causes a ValueError if it does not find the specified substring.
False. String method find returns -1 in this case. String method index causes a ValueError.
(TRUE/FALSE) Built-in function get_input requests and obtains input from the user.
False. The built-in function's name is input.
(TRUE/FALSE) In nested parentheses, the expression in the innermost pair evaluates last.
False. The expression in the innermost parentheses evaluates first.
(TRUE/FALSE) The comparison operators evaluate left to right and all have the same level of precedence.
False. The operators <, <=, > and >= all have the same level of precedence and evaluate left to right. The operators == and != have the same level of precedence and evaluate left to right. Their precedence is lower than that of <, <=, > and >=.
(TRUE/FALSE) A variable always references the same object.
False. You can make an existing variable refer to a different object and even one of a different type.
Google's taught itself to play chess in less than four hours using reinforcement learning, then beat the world champion chess program, Stockfish 8, in a 100-game match—winning or drawing every game.
Google's taught itself to play chess in less than four hours using reinforcement learning, then beat the world champion chess program, Stockfish 8, in a 100-game match—winning or drawing every game.
Given that y = ax^3 + 7, which of the following is not a correct statement for this equation? a) y = a * x * x * x + 7 b) y = a * x ** 3 + 7 c) y = a * (x * x * x) + 7 d) y = a * x * (x * x + 7
d
presentation type f
It indicates what type is being formatted so Python can determine whether the other formatting information is allowed for that type
Refactoring
Reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality.
Preparing data for analysis is called or . A subset of this process is data cleaning.
data munging, data wrangling
Software Development Kits (SDKs)
The tools and documentation that developers use to program applications.
Cloud computing
You can use software and data stored in the "cloud"—i.e., accessed on remote computers (or servers) via the Internet and available on demand—rather than having it stored locally on your desktop, notebook computer or mobile device.
floating-point number
a number with a decimal point
string
a sequence of characters enclosed in single quotes (').
The ultimate goal of AI is to produce a(n) .
artificial general intelligence.
Assigning an object to a variable the variable's name to the object
binds.
Presentation type formats a character code as its corresponding character.
c
Method replace
can receive an optional third argument specifying the maximum number of replacements to perform.
You use to document code and improve its readability
comments
String method join
concatenates the strings in its argument, which must be an iterable containing only string values; otherwise, a TypeError occurs
Method title
copies the original string and returns a new string with only the first character of each word capitalized (this is sometimes called book-title capitalization)
Method capitalize
copies the original string and returns a new string with only the first letter capitalized (this is sometimes called sentence capitalization):
Method returns the number of times a given substring occurs in a string.
count
crowdsourced data
data that's continuously supplied by their users and their users' devices worldwide
variety
data used to be alphanumeric (that is, consisting of alphabetic characters, digits, punctuation and some special characters)—today it also includes images, audios, videos and data from an exploding number of Internet of Things sensors in our homes, businesses, vehicles, cities and more.
s presentation type
default. If you specify s explicitly, the value to format must be a variable that references a string, an expression that produces a string or a string literal, as in the first placeholder below.
Tokens are separated from one another by .
delimiters
The range of a collection of values is a measure of .
dispersion
True division (/)
divides a numerator by a denominator and yields a floating-point number with a decimal point
Floor division (//)
divides a numerator by a denominator, yielding the highest integer that's not greater than the result.
Presentation types and format floating-point and Decimal values in scientific notation.
e, E.
c presentation type
formats an integer character code as the corresponding character
d presentation type
formats integer values as strings
type
indicates the kind of data the value represents
tokens
individual words
The built-in function converts a floating-point value to an integer value or converts a string representation of an integer to an integer value
int
Method returns True if a string contains only letters and numbers.
isalnum.
Method returns True if a string contains only letters.
isalpha
dynamic typing
it determines the type of the object a variable refers to while executing your code
IBM's Watson beat the two best human Jeopardy! players. Watson was trained using a combination of learning and learning techniques.
machine, reinforcement.
identifier
may consist of letters, digits and underscores (_) but may not begin with a digit
String methods find and rfind
perform the same tasks as index and rindex but, if the substring is not found, return -1 rather than causing a ValueError
function
performs a task when you call it by writing its name, followed by parentheses, ()
String method rindex
performs the same operation as index, but searches from the end of the string and returns the last index at which the substring is found; otherwise, a ValueError occurs
The function instructs the computer to display information on the screen
exponentiation (**) operator
raises one value to the power of another
Method lstrip
removes only leading whitespace
Method rstrip
removes only trailing whitespace
input function
requests and obtains user input
String methods startswith and endswith
return True if the string starts with or ends with a specified substring
string method isdigit
returns True if the string on which you call the method contains only the digit characters (0-9)
Method splitlines
returns a list of new strings representing the lines of text split at each newline character in the original string
String method count
returns the number of times its argument occurs in the string
Function finds in a string the first substring that matches a regular expression
search
String method index
searches for a substring within a string and returns the first index at which the substring is found; otherwise, a ValueError occurs
statement
specifies a task to perform
String method partition
splits a string into a tuple of three strings based on the method's separator argument. The three strings are the part of the original string before the separator, the separator itself, and the part of the string after the separator.
Values of the data type contain a sequence of characters.
string (type str)
volume
the amount of data the world is producing is growing exponentially.
velocity
the speed at which that data is being produced, the speed at which it moves through organizations and the speed at which data changes are growing quickly
veracity
the validity of the data—is it complete and accurate? Can we trust that data when making crucial decisions? Is it real?
Any string can be a regular expression
true
Exponential (scientific) notation
used to format the values more compactly
if statement
uses a condition to decide whether to execute a statement (or a group of statements)
What is the four V's of big data
volume, velocity, variety, veracity
remainder operator (%)
yields the remainder after the left operand is divided by the right operand