05 Flashcards
The _________ function uses integers to indicate where to start, stop, and by how much it should change to create a sequence of integers.
range
If the numerical range is arithmetically invalid, it will raise an error T/F?
False, it will create an empty sequence
Howe do you tell something is a function in python?
def
How do I edit or use a global variable inside a function
global x
x = 5
A ________ is a file that contains one or more functions and/or classes that may be reused to save time writing and debugging source code
python module
How do you import a module in python?
How do you see a lit of available modules?
import re
help(‘module’)
When creating a expression/search pattern in python using regex whats the format of it?
expression = r”\w+”
A ______ modifies the way a regulkar expression examines data. can you use the pipe to look at more then one?
flag, yes
_________ ___________ Makes the . (match any character)), include <newline></newline>
________ __________ Allow case insensitive searches on a string
________ __________ Allows the expression to search for strings which span multiple lines
re.DOTALL re.S
re.IGNORTECASE re.I
re.MULTILINE re.M
The ________ ___________ looks through the entire string for the pattern specified. If the pattern is found, a match object is returned, otherwise no value is returned
search function
The _______ _________ returns a list of strings for each match to all non-overlapping values in a specified string
findall() function
The __________ block is provided as a built-in technique to handle errors. What the syntax for it?
try-except
try:
sucessful code operation
except OsError
“There was a problem in meemory”
_________________ An illegal arthi8metic operation. E.g. division by zero or a math result too large for the containing data type
_________ When a system function returns a system-related error. E.g. I/O failures like “file not found” or connection failures like “socket failures”
_______________ The subscripted index is specified out of range E.g., trying to access the 10th element of a list of five numbers
_____________ An operation applied to an object of an inappropriate data type. E.g. trying to divide a string by an integer
____________ An operation or function received the correct data type, but the value given was inappropriate
ArthimaticError
OsError
IndexError
TypeError
ValueError
Sockets are __________ that allow software to communicate and send data across a network connection via access to a computers nic
objects
By default all sockets are tcp T/F?
T