Which of the following statements is true about control structures?
1 point
1
Question 3
3.
Which of the following does the clear command do?
A. Clears the screen of any markings left by Tracy
B. Turns Tracy to face right
C. Sends Tracy to position (0,0)
1 point
1
Question 4
4.
What will the output of the following code be?
1 point
1
Question 5
5.
1 point
1
Question 6
6.
How is an infinite loop created?
1 point
1
Question 7
7.
Why do we use while loops?
1 point
1
Question 8
8.
What would be the radius of the circle output from the following code?
1 point
1
Question 9
9.
Which of the following if/else statements using a variable called ‘count’ are written correctly?
1 point
1
Question 10
10.
What is the limit of conditions that can be used in an if/else statement?
1 point
1
Question 11
11.
Which of the following is an example of an if/else statement scenario?
1 point
1
Question 12
12.
If the following code was run, how far would Tracy move?
1 point
1
Question 13
13.
Which comparison operator means ‘is not equal to’?
1 point
1
Question 14
14.
How would we write an if statement where Tracy will put the pen down if a variable called count was positive?
1 point
1
Question 15
15.
If we write an if statement and the condition is false, what does Tracy do?
1 point
1
Question 16
16.
Why do we use if statements?
1 point
1
Question 17
17.
What is the default starting value of i in a for loop?
1 point
1
Question 18
18.
Variables allow us to:
1 point
1
Question 19
19.
Which of the following is NOT an example of using Top Down Design?
1 point
1
Question 20
20.
Top Down Design makes it easier to solve a problem by:
1 point
1
Question 21
21.
What punctuation is needed to begin a multi-line comment?
1 point
1
Question 22
22.
What symbol is used at the beginning of an in-line comment?
1 point
1
Question 23
23.
Comments are:
1 point
1
Question 24
24.
What are the dimensions of Tracy’s world?
1 point
1
Question 25
25.
When Tracy is facing right, from what location does she start drawing her circle?
1 point
1
Question 26
26.
When using the circle() command, what value do we put inside the parentheses?
1 point
1
Question 27
27.
Which of the following statements is true?
I. Computers have only been around since the 1940’s
II. One reason computers were first developed was to do mathematical computations faster
III. Some modern computers include laptops, cell phones, and tablets
IV. Computers are able to perform tasks by using logic
1 point
1
Question 28
28.
Which of the following statements is the simplest and most accurate definition of a computer?
1 point
1
Question 29
29.
Which of the following choices correctly orders the early types of computers from earliest to most recent?
1 point
1
Question 30
30.
What is the purpose of an output device?
1 point
1
Question 31
31.
What is the purpose of an input device?
1 point
1
Question 32
32.
What is the purpose of a network device?
1 point
1
Question 33
33.
What is the purpose of a storage device?
1 point
1
Question 34
34.
Which of the following statements is something the operating system of a computer is responsible for doing?
1 point
1
Question 35
35.
Which of the following items is an example of a user application?
I. Browser
II. Text editor
III. Games
IV. File Explorer
1 point
1
Question 36
36.
Which of the following choices lists the three main components of a computer’s hardware?
1 point
1
Question 37
37.
What does CPU stand for?
1 point
1
Question 38
38.
Which of the following devices is the device that connects all of the physical components of a computer together?
1 point
1
Question 39
39.
Which of the following fields use computers?
I. Computer Science
II. Medicine
III. Video Gaming
IV. Automotive (Cars)
1 point
1
Question 40
40.
Which of the following is an application of Artificial Intelligence?
2 points
2
Question 41
41.
Match the term to the definition
Draggable item
arrow_right_alt
Corresponding Item
Binary Operators
arrow_right_alt
Operators that occur between two things
Unary Operators
arrow_right_alt
Operators that only apply to one thing
7 points
7
Question 42
42.
Know what operations the following symbols represent.
+ ⇛ _______
- ⇛ _______
* ⇛ _______
/ ⇛ _______
** ⇛ _______
% ⇛ _______
- ⇛_______ (unary operator)
// ⇛ _______
4 points
4
Question 43
43.
In the following equation, in what order do you complete the operations in Python? (drag to reorder)
6 - 3 ** 2 / (1 + 1)
6 - 3
1 + 1
2/
3 ** 2
4 points
4
Question 44
44.
In the following equation, in what order do you complete the operations in Python? (drag to reorder)
(6 + (3 - 2 * 2)) ** 2
6 + (_____)
2 * 2
3 - 2
(______) ** 2
6 points
6
Question 45
45.
Which of the following statements will cause an error assuming age has the value 15 and student the value Billy-Bob
1 point
1
Question 46
46.
Which one of the statements below will cause an error?
5 points
5
Question 47
47.
What type the variable on the left getting in each line
z = x * y
y = 4
a = y + .9
b = x + y
x = "bar"
str
int
float
This line will cause a crash
9 points
9
Question 48
48.
I detify the value that would be stored in each type
6
-3.14
"5.6"
7.0
-15
"user"
"elephant"
0.9
"name"
String
Integer
Float
2 points
2
Question 49
49.
- _______ is the character(s) used to start an in-line Python Comment
- _______ is the character(s) used to start a multiline Python Comment
4 points
4
Question 50
50.
Reorder the statements to put them in the order to get input from the user and print out the result
print("Your favorite color is " + user_color)
print("You have chosen " + confirm)
confirm = input("Is that correct? (Yes or No)")
user_color = input("What is your favorite color? ")
1 point
1
Question 51
51.
What is the output of the following program? Assume the user enters "Will Smith", then "Wild Wild West"?
favorite_actor = input ("What is your favorite Actor? ")
best_movie = input ("What is your favorite move that actor is in? ")
fav_movie_actor = favorite_actor + best_movie
1 point
1
Question 52
52.
What would be the proper way to name a variable in Python that stores the users ID number
15 points
15
Question 53
53.
Answer the following questions about the program below
students = int(input("Number of students: ")
size_of_groups = int(input("How many in a group: ")
num_per_group = students // size_of_groups
students_remaining = students % size_of_groups
print("Each group will be " + str(num_per_group) + " students with one group of " + str(students_remaining))
What does the Python program do?
What is the purpose of // in this program?
What is the % operator doing in this program?
1 point
1
Question 54
54.
Is there any limit of statement that can appear under an if block.
1 point
1
Question 55
55.
What print statement will run if the user enters 19 when prompted?
age=int(input("Enter your age"))
if age >=18:
print("Eligible for voting")
else:
print("not eligible for voting")
1 point
1
Question 56
56.
The if...elif...else executes only one block of code among several blocks
1 point
1
Question 57
57.
How would you round the number held in the variable e to 2.718?
1 point
1
Question 58
58.
How would you round the number 10.758321 held in the variable num1 to 10.76?
3 points
3
Question 59
59.
A company decided to give bonus of 5% to employee if his/her year of service is more than 5 years.
Ask user for their salary and year of service and print the net bonus amount. Fill in the blanks to complete the below code.
salary = _______"Enter salary: ") )
yos = _______"Enter year of service"))
if _______>5:
print "Bonus is",.05*salary
else:
print "No bonus"
1 point
1
Question 60
60.
What will print to the screen when the following program is run?
number = 10
greater_than_pi = number > 3.14
print(type(number)
1 point
1
Question 61
61.
What will print to the screen when the following program is run?
number = 10
greater_than_pi = number > 3.14
print(type(greater_than_pi)
1 point
1
Question 62
62.
What will print to the screen when the following program is run?
value = -7.52
less_than_zero = value < 0
print(type(less_than_zero)
1 point
1
Question 63
63.
What will print to the screen when the following program is run?
value = -7.52
less_than_zero = value < 0
print(less_than_zero)
1 point
1
Question 64
64.
What will the results be of the following statement
5 == 5
1 point
1
Question 65
65.
What will the results be of the following statement
3 == 5
1 point
1
Question 66
66.
What will the results be of the following statement
5 == 5.0
1 point
1
Question 67
67.
What will the results be of the following statement
"eric" == "eric"
1 point
1
Question 68
68.
What will the results be of the following statement
"Eric" == "eric"
1 point
1
Question 69
69.
What will the results be of the following statement
"5" == 5
1 point
1
Question 70
70.
What will the results be of the following statement
num1 = 5
"5" == str(num1)
3 points
3
Question 71
71.
Write a program that does the following:
Assign 10 to x. If x is bigger than 0, print "x is a positive number".
5 points
5
Question 72
72.
Write a program that does the following:
Assign -50 to y. If y is bigger than 0, print "y is a positive number". Else, print "y is a negative number".
8 points
8
Question 73
73.
Write a program that does the following:
Assign 0Â to z. If z is bigger than 0, print "z is a positive number". Else if z is zero, print "z is 0". Else, print "z is a negative number".
1 point
1
Question 74
74.
Given the nested if-else structure below, what will be the value of x after code execution completes
x = 0
a = 0
b = -5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
1 point
1
Question 75
75.
Given the nested if-else below, what will be the value x when the code executed successfully
x = 0
a = 5
b = 5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
1 point
1
Question 76
76.
What does the following code print to the console?
What signifies the end of a statement block or suite in Python?
4 points
4
Question 83
83.
Write an if statement that asks for the user's name via input() function. If the name is "Bond" make it print "Welcome on board 007." Otherwise make it print "Good morning NAME". (Replace Name with user's name)
1 point
1
Question 84
84.
The break statement causes what?
1 point
1
Question 85
85.
The continue statement causes what?
1 point
1
Question 86
86.
What is the result of executing the following code?
number = 5
while number <= 5:
if number < 5:
number = number + 1
print(number)
1 point
1
Question 87
87.
What will the following code print?
counter = 1
sum = 0
while counter <= 6:
sum = sum + counter
counter = counter + 2
print(sum)
1 point
1
Question 88
88.
What is the last thing printed when the following code is run?
number = 0
while number <= 10:
print("Number: ", number)
number = number + 1
1 point
1
Question 89
89.
What does the following code print?
output = ""
x = -5
while x < 0:
x = x + 1
output = output + str(x) + " "
print(output)
1 point
1
Question 90
90.
The following code contains an infinite loop. Which is the best explanation for why the loop does not terminate?
n = 10
answer = 1
while n > 0:
answer = answer + n
n = n + 1
print(answer)