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
Simple, clean syntax
B
Most commonly used language to write software
C
Platform independent (runs everywhere)
D
Free and powerful
2) Name the two basic modes of IDLE.
A
shell and notes
B
interactive and script
C
interactive and shell
D
notes and programs
3) What is a sequence of characters called?
A
Iteration
B
String
C
Float
D
List
4) What are a set of characters that allow you to insert special characters into a string?
A
Escape sequence
B
For loop
C
Concatentation
D
Index values
5) What type of value will the input function return to you?
A
String
B
Integer
C
It depends
D
Float
6) An error that will not crash your program, but produces unintended results is...
A
Logic error
B
Sequencing error
C
Script error
D
Syntax 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
not
B
and
C
or
D
nor
9) Which of the following definitions describes a 'block' of code?
A
A module imported into Python
B
None of the above
C
A section of code that runs independent of the rest of a program
D
One or more consecutive lines of code indented (logically form a unit)
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
Static variable
C
Condition
D
Value
11) A type of immutable sequence that can contain elements of any type (uses parentheses).
A
Dictionary
B
List
C
String
D
Tuple
12) Which is a difference between a tuple and a list?
A
One is a sequence
B
One can be stored in a variable
C
One is mutable
D
One is iterable
13) Write a for loop that will count from 10 to 40 by 2’s (assume proper tabbing).
A
for i in range(10, 40, 2): \ print (i, end=' ')
B
for i in range(10, 41,): \ print (i+2, end=' ')
C
for i in range(10, 41, 2): \ print (i, end=' ')
D
for i in range(2, 10, 40): \ 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 s)
B
for s in sox: \ (print sox)
C
if s in sox: \ (print s)
D
while 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 12 9 on separate lines
B
2 9 12 on separate lines
C
2 12 9 on the same line
D
2 9 12 on the same
16) Which of the following can be used to count to a certain number.
A
if-elif-else statement
B
while loop
C
print statment
D
for 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
2 4 6 8
C
0 2 4 6 8 10
D
0 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
div()
C
str()
D
int()
19) When writing a menu-based program, the menu structure should be...
A
Nested if-elif-else block inside a while loop
B
Nested for loops inside a while loop
C
A while loop nested in a for loop
D
Nested for loops inside if-elif-else statements
20) Which slice will turn the sting 'summer vacation' into 'summer'? (assume brackets are present)
A
0:5
B
1:5
C
:6
D
0:7
*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?