Review Game Zone
Flash Cards
(current)
Games
Teachers
Search
Computer Programming 1 Final Exam Review
Test Description: Review games to help with the Programming 1 final exam.
Instructions: Answer all questions to get your test result.
1) Which of the following is NOT an advantage to the Python programming language?
A
Most commonly used language to write software
B
Platform independent (runs everywhere)
C
Simple, clean syntax
D
Free and powerful
2) Name the two basic modes of IDLE.
A
interactive and script
B
notes and programs
C
shell and notes
D
interactive and shell
3) What is a sequence of characters called?
A
List
B
Iteration
C
String
D
Float
4) What are a set of characters that allow you to insert special characters into a string?
A
Index values
B
Concatentation
C
For loop
D
Escape sequence
5) What type of value will the input function return to you?
A
Integer
B
Float
C
It depends
D
String
6) An error that will not crash your program, but produces unintended results is...
A
Sequencing error
B
Script error
C
Syntax error
D
Logic error
7) Which of the following is an assignment operator?
A
==
B
,
C
=
D
:
8) Which of the following is not one of the three logical operators?
A
nor
B
and
C
not
D
or
9) Which of the following definitions describes a 'block' of code?
A
One or more consecutive lines of code indented (logically form a unit)
B
A module imported into Python
C
A section of code that runs independent of the rest of a program
D
None of the above
10) Part of the while loop which is used in the condition and compared to some other value or values—will need to initialize this before the loop.
A
Sentry variable
B
Condition
C
Static variable
D
Value
11) A type of immutable sequence that can contain elements of any type (uses parentheses).
A
String
B
Tuple
C
Dictionary
D
List
12) Which is a difference between a tuple and a list?
A
One is mutable
B
One is iterable
C
One can be stored in a variable
D
One is a sequence
13) Write a for loop that will count from 10 to 40 by 2’s (assume proper tabbing).
A
for i in range(2, 10, 40): \ print (i, end=' ')
B
for i in range(10, 41,): \ print (i+2, end=' ')
C
for i in range(10, 40, 2): \ print (i, end=' ')
D
for i in range(10, 41, 2): \ print (i, end=' ')
14) How would I print out each element in the following tuple (assume proper tabbing)? sox = (“Thome, “Anderson, “Ramirez, “Pierzynski)
A
for s in sox: \ (print sox)
B
while s in sox: \ (print s)
C
for s in sox: \ (print s)
D
if s in sox: \ (print s)
15) What will the following code display (assume proper tabbing)? equipment = (dagger, 2), (sword, 12), (shield, 9) \ for item in equipment: \ name, cost = item \ print(cost)
A
2 9 12 on the same
B
2 9 12 on separate lines
C
2 12 9 on separate lines
D
2 12 9 on the same line
16) Which of the following can be used to count to a certain number.
A
if-elif-else statement
B
print statment
C
for loop
D
while loop
17) What will the following code display (assume proper tabbing)? count = 0 \ while count != 10: \ print (count,end='') \ count += 2
A
2 4 6 8 10
B
0 2 4 6 8 10
C
0 2 4 6 8
D
2 4 6 8
18) If you want to perform true division in an operation, which function will help you convert values?
A
float()
B
str()
C
int()
D
div()
19) When writing a menu-based program, the menu structure should be...
A
A while loop nested in a for loop
B
Nested for loops inside if-elif-else statements
C
Nested if-elif-else block inside a while loop
D
Nested for loops inside a while loop
20) Which slice will turn the sting 'summer vacation' into 'summer'? (assume brackets are present)
A
1:5
B
0:7
C
:6
D
0:5
*select an answer for all questions
Check Results & Get Answers
Play Games with the Questions Above
Teachers: Create FREE classroom games with your questions
Click for more info!
©2007-2024
ReviewGameZone.com
|
About
|
Privacy
|
Contact
|
Terms
|
Site Map
WAIT! Find what you needed?
×
Still Looking for the Answers?
Have Another Question?
Play a Review Game with These Questions?
Want to Make Your Own Test Like This One?