CS Python Final Exam Flashcards
When to use a For loop
When the number of iterations is known
When to use a while loop
While the statement is true
What would for x in range(2,6) print?
2
3
4
5
range(a, c) function
it prints a and b BUT NOT C
Is for i in range(0,10) the same as for i in range(10) ?
yes
what is the name of the panel in ear sketch that contains all of the assembled audio clips?
Digital Audio Workstation
Which of the following is NOT an example of Top Down design?
a) separating a large problem into a smaller one
b) writing code for one part of a function before tackling the whole thing
c) using descriptive names for variables
d) breaking a large code into smaller functions
c) using descriptive names for variables
Top down design makes it easier to solve a problem as it
breaks the problem down into smaller parts
The input() function in python returns the user input as a …
string
Variables allow us to
store information to use in our programs
If programmers write an if statement and the condition is false, what does turtle do?
Turtle skips the command under the if statement
What is missing? What should be written?
import tkinter as tk
m = tk.Tk()
#Widgets added here
The last line of code,
m.mainloop()
How do you name a window in tkinter?
title = tk.Tk()
How do you import tkinter
import tkinter
How many possible values are there for a boolean variable?
2