Which of the following falls under the field of computer science? Logical Thinking, Data, Algorithms, All of the above.
All of the above
What are the possible outputs of the following?
print(random.randint(1, 5))
1,2,3,4,5
To test if x is less than or equal to y:
if (x ___ y):
What symbol would you use?
<=
Loops can be used to __________
Repeat sections of code
What symbol is used in python to create a comment?
#
Python is an example of __________
Formal Language
What is the symbol for integer division?
//
When do you use an elif statement?
To check multiple expressions for TRUE and execute a block of code as soon as one of the conditions evaluate to TRUE
What should be entered to make the loop below print
55,60,65
x = 50
while (x < 65):
x = x + ____
print (x)
5
Symbols that store values are called what?
variables
Using a mouse to click on an email is an example of
Input
Consider the following code:
a = 2
b = 3
print(a ** b)
What is the output?
8
When is a compound conditional true when using the keyword 'or'?
One test is true and the other is false.& Both tests are true
The following loop is intended to print the numbers
2 4 6 8 10
Fill in the blank:
for i in ________:
print (i)
range(2,11,2)
Which command can be used to convert variables into an integer?
int()
What is a variable? Define & Example
Variables are a name for a spot in the computer's memory
c = 1
To generate numbers between and including -5 to 5 you would use:
random.randint(-5,5)
When should you use an else statement?
To execute code if none of the other expressions were TRUE
Consider the following code:
for r in range (5, 21, 5):
print("Thomas")
How many times will the name be printed?
4
What do we call sets of large data that are so big or complex that normal programs and applications are not able to process them?
Big Data
Which of the following would be the best variable name to store the value of your English number grade?
EG, N,G1, number_Grade
Convert the following decimal number to binary:
5
101
The following code will not compile. Spot the but that would allow the code to compile and run as intended?
if (x >= -10 and <= 10):
print("In range")
if (x >= -10 and x <= 10):
What is output by the following code?
for i in range(73, 43, -2):
print(i)
All the numbers from 73 to 45 counting backwards by 2
What line of code correctly stores and inputs user's name?
n = str(input("Enter: "))