Storing a value in a variable.
Assignment
Symbol that defines a math operation.
Operator
8 ** 2
64
Write a code that does the following: 43
import math
math.pow(4, 3)
OR
4 ** 3
What is the output?
x = 50
print("Answer is " + x)
Cannot concatenate string and number
Gives the remainder of integer which have been divided.
Modular Division (%)
Collection of commands given a name, ex.: input()
functions
5 - 4 * 9 + 3
-28
Complete the code:
x = 6
y = 10
# Add these two variables together
x + y
What is the output?
print (56 / 0)
ERROR: Cannot divide by zero.
pulls in code to add functions to your code.
import
Collection of code and functions that perform similar tasks.
Module
3 % 10 * 5 - (5 * 3)
0
Use a command that will display a red screen.
RGB(255, 0, 0)
56.0 is what type of datatype?
float
Command used to mix colors - red, green, and blue
RGB
2^40 or one million million (10^12) bytes
Terabyte
6 * 8 / 3 % 7 * 4
8
Random a number between 10 and 50
import random
random.randint(10, 50)
What is the output?
x = ("animal", "apple", "april", "ape", "are")
print(min(x))
animal
Module used to create random numbers in programs. Numbers are not really random.
Random
Data sets that are too large and complex for traditional data processing applications.
((8 * 6) + 4) % (6 + 4) * 9 / 3
6
Complete the code:
x = (10, 20, 30, 25, 45, 12, 42, 9, 11)
# How do we find the maximum value in the dataset stored in x and then display it?
print(max(x))
Name three functions that are used in the math module.
fabs
pow
sqrt