Computer Programming 1 Final Exam Review: Question Preview (ID: 31454)

Below is a preview of the questions contained within the game titled COMPUTER PROGRAMMING 1 FINAL EXAM REVIEW: Review Games To Help With The Programming 1 Final Exam. To play games using this data set, follow the directions below. Good luck and have fun. Enjoy! [print these questions]

Play games to reveal the correct answers. Click here to play a game and get the answers.

If you want to perform true division in an operation, which function will help you convert values?
a) int() b) float() c) str() d) div()
What will the following code display (assume proper tabbing)? count = 0 \ while count != 10: \ print count, \ count += 2
a) 0 2 4 6 8 10 b) 0 2 4 6 8 c) 2 4 6 8 d) 2 4 6 8 10
Which of the following can be used to count to a certain number.
a) if-elif-else statement b) while loop c) for loop d) print statment
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 the same line b) 2 12 9 on separate lines c) 2 9 12 on separate lines d) 2 9 12 on the same
How would I print out each element in the following tuple (assume proper tabbing)? sox = (“Thome, “Anderson, “Ramirez, “Pierzynski)
a) while s in sox: \ print s b) if s in sox: \ print s c) for s in sox: \ print sox d) for s in sox: \ print s
A type of immutable sequence that can contain elements of any type (uses parentheses).
a) Tuple b) List c) Dictionary d) String
Write a for loop that will count from 10 to 40 by 2’s (assume proper tabbing).
a) for i in range(10, 41, 2): \ print i, b) for i in range(2, 10, 40): \ print i, c) for i in range(10, 40, 2): \ print i, d) for i in range(10, 41,): \ print i+2,
Which of the following is an assignment operator?
a) == b) , c) = d) :
Which of the following is not one of the three logical operators?
a) and b) or c) not d) nor
Which of the following definitions describes a 'block' of code?
a) A module imported into Python b) One or more consecutive lines of code indented (logically form a unit) c) A section of code that runs independent of the rest of a program d) None of the above
Which is a difference between a tuple and a list?
a) One is iterable b) One is a sequence c) One is mutable d) One can be stored in a variable
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) Value b) Condition c) Sentry variable d) Static variable
An error that will not crash your program, but produces unintended results is...
a) Syntax error b) Logic error c) Sequencing error d) Script error
What are a set of characters that allow you to insert special characters into a string?
a) Escape sequence b) For loop c) Index values d) Concatentation
What type of value will the raw_input function return to you?
a) Integer b) It depends c) Float d) String
What is a sequence of characters called?
a) Float b) Iteration c) List d) String
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) Free and powerful d) Platform independent (runs everywhere)
Name the two basic modes of IDLE.
a) interactive and script b) shell and notes c) interactive and shell d) notes and programs
When writing a menu-based program, the menu structure should be...
a) A while loop nested in a for loop b) Nested if-elif-else block inside a while loop c) Nested for loops inside a while loop d) Nested for loops inside if-elif-else statements
Which slice will turn the sting 'summer vacation' into 'summer'? (assume brackets are present)
a) 0:5 b) :6 c) 1:5 d) 0:7
Play Games with the Questions above at
To play games using the questions from the data set above, visit and enter game ID number: 31454 in the upper right hand corner at or simply click on the link above this text.

Log In
| Sign Up / Register