Module 1 Flashcards
Python Basics
Assignment operator in Python
symbol is “=”
type of Binary operator that helps in modifying the variable to its left with the use of its value to the right
Arithmetic Operations
basic calculations made in daily life (+, -,*, /)
Array of numbers
set of #s or objects that follow a pattern presented as an arrangement of rows and columns to explain multiplication
Backslash
escape character used in Python strings to indicate that the character immediately following it should be treated in a special way (i.e. escaped character or raw string)
Boolean
Denoting a system of algebraic notation used to represent logical propositions by means of the binary digits 0 (false) and 1 (true)
Colon
represents an indented block
also used to fetch data and index ranges or arrays
Concatenate
Link (things) together in a chain or series
s1 = Hello
s2 = world
concatenated_string = s1 + s2
result = Hello world
Data engineering
turning raw data into information that an organization can understand and use by blending, testing, and optimizing data from numerous sources
Data science
interdisciplinary field that focuses on extracting knowledge from data sets which are typically huge in amount
encompasses analysis, preparing data for analysis, and presenting findings to inform high-level decisions in an organization
Data type
type of value a variable has and what type of mathematical, relational, or logical operations can be applied without causing an error
Single and Double Quote
symbol ‘ ‘ and “ “
used to represent strings in Python
Escape sequence
two or more characters that often begin with an escape character that tell the computer to perform a function or command
Application development
process of planning, designing, creating, testing, and deploying a software application to perform various business operations
Expression
combination of operators and operands that is interpreted to produce some other value
Float
Python float () function is used to return a floating-point number from a number or a string representation of a numeric value
Immutable
immutable objects are in-built datatypes (int, float, bool, string, Unicode, and tuple)
they cannot be changed after they are created
Integer
whole numbers (+, 0, -)
Manipulate
process of modifying a string or creating a new string by making changes to existing strings
Mathematical operations
calculating a value using operands and a math operator
Negative indexing
allows you to access elements of a sequence from the end, using negative numbers as indexes (-1 starting from last element R > L)
Operands
quantity on which an operation is done
Operators in Python
perform operations on variables and values
Replicate
make exact copy of
Sequence
function whose domain is an interval of integers
Slicing in Python
return a portion from defined list
name[x:y:z] x (start pt), y (end pt), z (stride)
Special characters
one that is not considered a # or letter (symbols, accent marks, punctuation marks)
Stride value
of bytes from one row of pixels in memory to the next row of pixels in memory
Strings in Python
words
Substring
sequence of characters that are part of an original string
Type casting
process of converting one data type to another data type (aka Type coercion/conversion)
Types in Python
data types represent the kind of value that tells what operations can be performed on particular data
#
comment - ignored by Python executing code
Indexing
my_string = “Michael”
mystring[0:4]
Mich
Length
len(string_name)
convert string to lowercase
lower()
my_string.lower()
Print message or variable inside ()
print(“ “)
a = “1”
b = “2”
print (a+b)
12
addition operator
+sub
subtraction operator
-
multiplication operator
*
division operator
/
floor division operator
//
division truncated after decimal
modulo operator
% (remainder of division)
replace substrings
replace()
string1 = “Hello”
string2 = string1.replace(“Hello”, “Hi”)
extract a portion of string
slicing
my_string = “Hello, world”
substring = my_string[0:5]
split string into a list based on delimiter
split()
split_text = my_string.split(“,”)
convert string to uppercase
upper()
my_string.upper()
remove leading/trailing whitespace
strip()
s1.strip()