What is putting information into a computer?
input.
What does % do?
it gives the remainder of the number.
if(x = 2)
Whats wrong with the code above?
there should be ==
What does a while loop do?
it repeats code until a condition is meet.
What does the command int( do?
Change a string to a number.
what should you do before using random.randint()?
you need to import random.
what are the 3 conditions to an if statement
and, or, not
What is information sent to a function as?
a parameter.
What data type is used to store words?
str(
x = 5
print("The number is: " + x * 3)
What is wrong with the code above?
A str( is needed.
What are the conditions are needed for an if statement to work?
indent their code block.
T/F
Do algorithms repeat indefinitely?
False
What memory system do computers use?
binary
print("Enter 3 numbers: ")
a = float(input("Enter a number: "))
b = float(input("Enter a number: "))
c = float(input("Enter a number: "))
print(a + b + c / 3)
if a was 6, b was 7, and c was 12 what would the result be?
17
when do you use and elif statement compared to an if else statement?
To check multiple expressions for true and execute a block of code as soon as one of the conditions evaluate to true.
What does range (11, 34, 2) do?
it prints the odd numbers between 11 and 33/34
What does \\ do?
it does nothing.
what does fabs( do?
it converts a number to a float.
T/F
Do algorithms have an order?
True
for i in range (x, y): print (i, end=" ")
what two numbers return 10 11 12 13 14 15 16 17 18 19
X= 10
Y= 20