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