No student devices needed. Know more
41 questions
What is an IF statement used for? Select all that apply.
Select between options in a program
Repeat sections of code
To count user input
Make True/ False decisions
!=
Equal
Not equal to
emotionally equal
false
Equal to
=
=2
><
==
<
less than
more than
significant
greater than
<=
greater than or equal to
arrow
less than or equal to
equal to
>
greater than
less than
>=
greater than or equal to
greater than and equal to
less than or equal to
less than and equal to
% this symbol, in Python, outputs what?
quotient
dividend
remainder
divisor
Write the code to test if num1 and num2 are the same.
Consider the following code:
x = 18
if (x > 18):
print(1)
elif (x < 18):
print(2)
else:
print(3)
What is the output?
Consider the following code:
x = int(input("Input an integer: "))
if (x >= 0):
print("Yay!")
else:
print("Boo!")
It outputs "Yay!" if the value is non-negative and "Boo!" if the value is negative.
Change the condition so that it only outputs "Yay!" if the value is non-negative (i.e. zero or positive) AND even.
x >= 0 or x % 2 == 0
x >= 0 or x % 2 == 1
x >= 0 and x % 2 == 0
x >= 0 and x % 2 == 1
The following line is seeing if the variable name1 is equal to the string Bob.
Select all options that would fix an error in the following code:
IF (name1 == Bob)
Change Bob to "Bob"
Change IF to if
Remove the parentheses in the code
Add a : (colon) at the end of the line of code
To test if a variable is between two numbers you would use:
Which of the following correctly tests if a number equals 90 or 100?
if (x == 90 or 100):
if (x == 90 and x == 100):
if (x == 90 and 100):
if (x == 90 or x == 100):
if (x > 40 and < 50):
The code above should be rewritten as:
Which of the following is true?
a = 15
b = 10
b >= a or a > b
a < b or a == b
a < b and a != b
a < b and a == b
It was easy to make the connection between code and ear sketch?
Yes
No
Maybe a little
You should remove earsketch
The print command is written:
(print)
What language did we use in programming?
Python
Python 2.0
C++
Java
Function that translates Strings to integer numbers.
int
integer
Str
String
str
Tells Python to handle the value in the ( ) as a String, not as a number.
str
Str
int
integer
String
What is a loop used for?
To repeat a function
Test if a condition false
To repeat code.
Help write python questions
A While Loop runs until
To repeat code.
The test condition is false____
_The test condition is true____
To set the value of a variable before a loop
What are the two ways of ending a loop?
User input
elif
count done
Count variable
A program that Thomas has written is complete. It has been tested thoroughly, and some outputs were not as expected. Thomas is now going through the code carefully attempting to establish the cause of these errors and change the code to remove them. What is this procedure called?
Debugging
Development
Coding
Spell Check
What is an algorithm?
What computers do
A series of steps/instructions intended to complete a task in a finite amount of time
The first step in any program
Checking your code for errors
What is output by the following?
print (10% 3)
0
1
2
3
To display the following on screen
Hello World!
the following command should be used:
print(Hello World!)
print("Hello World!")
print("Hello World" + !)
print"(Hello World!)"
Explore all questions with a free account