Used when you want a user to input a decimal
Float
Command that finds the smallest value in a set of values.
Min
A calculation which gives the remainder of integers which have been divided.
Modular Division
What is a number that this code might generate? random.randint(1,9)
1, 2, 3, 4, 5, 6, 7, 8, 9
What is the math function for absolute value and square root?
math.fabs()
math.sqrt()
A collection of commands given a name, for example, input( ).
Function
Command that finds the largest value in a set of values.
Max
The symbol used to represent integer division.
Write the code to print a random number between -12 and positive 8.
print(random.randint(-12,8))
What are the two ways to use exponents in Python?
x ** y
math.pow(x, y)
A collection of code and functions that perform similar tasks.
Module
Data sets that are too large and complex for traditional data processing applications.
Big Data
The symbol used to represent modular division.
%
What will the output be?
print (min("cat", "dog", "iguana", "anteater", "hedgehog", "fish", "aardvark"))
aardvark
What is output by the following:
x =4
x = x *6
print (x)
24
A name for a spot in the computer's memory
Variable
A symbol that defines a math operation.
Operator
What would be the output?
63%8
7
Write the code to find the product of two random integers. The output should be formatted like this:
The product is x.
num1 = random.randint(1,9)
num2 = random.randint(1,9)
print("The product is " + str(num1*num2))
What is output by the following:
x =6
y = -2
z =3
print (x + y * z)
0
Command that pulls in code to add functions to your code.
Import
What are the 3 data types we have used in Python?
float, integer, string
What would the output be:
num1 = 41//12
num2 = 41%12
print("Quotient: " + num1 + " Remainder: " + num2)
error: cannot concatenate
Write a program to find the remainder of two random integers.
num1 = random.randomint(1, 50)
num2 = random.randomint(1, 50)
print(num1%num2)
Write the code to print the square root of a negative number.
print(math.sqrt(math.fabs(x)))