1) the line of code after the line while num!=10: will be executed under what conditions?

the number is 10
the number is not 10
the loop has executed fewer than 10 times
the loop has executed more than 10 times

2) what kind of loop should be used in a game where the user is guessing a secret code and the message "guess again!" appears until the user guesses correctly?
for loop
binary loop
digital loop
while loop

3) the line of code after a line beginning with the word else needs to begin with a(n):
print statement
indentation
#
:

4) in python, what does the choice function do?
lets the user make a choice
lets the programmer make a choice
creates a new program
chooses a value at random from a string

5) which of these lines of code will generate a random number between 1 and 50?
input("1-50")
print ("1-50")
import random
num = random.randint (1,50)

6) which of the following communication tips would be MOST useful for explaining to a non-programmer how a very complicated python program works?
be clear and concise
be detailed and explain every line of code
only use one sentence
write a detailed report that is at least two pages long

7) la toya is creating a program that will teach young children to type. what keyboard should be used to create a loop that will print "try again" until the correct letter is typed?
else
print
while
random

8) which of the following statements is TRUE?
a name error occurs if the variable is referenced before it is declared
a name error occurs if a colon is put in the wrong place
a name error occurs if an else statement is used without an if statement
a name error occurs if two equals signs are used instead of one

9) in python, the symbol ! means not.
true
false

10) what does an iteration varaible do?
links to the database
translates from decimal to binary
keeps track of how many times a loop has executed
chooses whether to run a conditional statement

11) what are the three keywords that can begin conditional statements?
if, elif, else
if, when, then
if, also, then
if, then, else

12) sonja is writing a program to compare two numbers and print the larger number. which of these should be used?
while loop
if and else
if, elif, and else
string variable

13) hattie uses the line of code num = 7 to assign the number 7 to the variable named num. what correction should be made?
change 7 to seven
change num to Num
change == to –
change == to =

14) the variable that keeps track of how many times a loop has executed is called the conditional variable
true
false

15) a program contains an if statement followed by an else statement. when the condition in an if statement is met, what happens to the code in the else statement?
it is a name error
it is a syntax error
it is ignored
it is executed

16) a count-controlled loop repeats for a specific number of times.
true
false

17) when will an else statement be executed?
the if statement is true
the if statement is false
there is a syntax error
the elif statement is executed

18) why is it important to organize your thoughts before you communicate technical information?
to avoid appearing prideful
to avoid rambling
to appear competitive
to show off your programming skills

19) an if statement must always begin with the word if
true
false

20) if you want to add a third option to if and else, you can use:
print
input
alter
elif

21) the line after an if statement should begin with what?
#
a print statement
a colon
indentation

22) monique wants to show that she is actively listening to a user's helpful criticism and suggestions. which of the following should she do?
yawn
nod her head and make eye contact
look at her phone
grin

23) what is the function of a loop?
debug a problem
convert a binary to decimal
input a variable
repeat a section of code

24) random.choice will choose a number between 1 and 100
true
false

25) jasmine is creating a game where the same sequence will repeat four times. what kind of loop should be used for this feature of the game?
float loop
condition-controlled loop
count-controlled loop
binary loop

26) what determines the number of times that a condition-controlled loop will repeat?
the binary setting
user input
the programmer
a database

27) if the number of times that a loop repeats will be determined by whether the user inputs the correct answer to a trivia question, which kind of loop should be used?
float loop
condition-controlled loop
count-controlled loop
binary loop

28) which of the following statements is FALSE?
random words can be generated as well as random numbers
the random module is a group of functions that are used to deal with random numbers
to randomly choose an integer from a range, use the radiant function
a decimal number can be generated

29) which of these statements would create a variable but not assign anything to it?
variable = empty
variable = null
create variable
varaible = “”

30) marta is creating a program that will guide the user through a series of physical exercises. she wants the program to coach the user to do 10 push-ups. which kind of loop should she be using?
binary loop
condition-controlled loop
count-controlled loop
interface loop

31) a line of code that begins with the word while should end with which symbol?
#
"
.
:

32) under what circumstances will the indented line of code immediately after an if statement be executed?
if the condition is false
if the condition is true
if the line begins with a #
if the line contains a variable

33) what symbol must be used at the end of an if statement?
:
.
#


34) when should the double equal sign (==) be used?
to set the value of a decimal variable
to set the value of a float variable
to check whether two pieces of data are actually equal
to indicate greater or less than

35) which of these lines of code will increment a variable?
print (variable)
count (variable)
inc (variable)
variable = variable + 1

36) if a program needs to respond to what the user inputs by printing one of the three statements, what will the program require?
database
random number generator
decision generator
conditional statement

37) bruno is asked to create a program that will require the user to enter a passcode. if the wrong passcode is entered, the user can try again until they get it right. what kind of loop should be created for this?
binary loop
condition-controlled loop
count-controlled loop
interface loop

38) which symbol must be used at the end of a line that begins with else?
#
*
==
:

39) which function generates a random number?
randint
randstring
random.choice
guess

40) brandon wants to attend a session at a Python programming conference that will help improve skills ensuring that the data users enter is correct, meaningful, and in the right format. which of these conference sessions is most likely to meet Brandon's needs?
New Debugging Strategies
New Users for Conditional Loops
New Interfaces
New Validating Techniques

41) ying sends a program to a colleague for help in debugging it. the following message is returned: "you forgot to initialize the variable for the number of attempts." how should this problem be fixed?
set the variable to a beginning value
set the variable to an ending value
allow the user to input the variable's value
create a literal value

42) maria is creating a game that will need a random number. which line of code should be included in this program?
import random
print (random number)
num = random
create random

43) chinh wants to have a program print "sorry, but that isn't one of your options." until the user enters the correct information. what should be used to do this?
database
import
while loop
for loop

44) if you wanted to create a line of code that would add ten to the user's current score, which code should you use?
score == score + 10
score = score + score
score = score + 10
if score, then +10

45) which key do you press on the keyboard to indent a statement?
tab
shift
ender
ctrl

46) which of these expressions is used to check whether num is equal to value?
num ? value
num = value
num - value – value
num == value

47) what are the necessary parts of an if statement?
if, a variable, a semi-colon
if, a print statement, a colon
if, a condition, a colon
if, a print statement, a semi-colon

48) the iteration variable begins counting with which number?
0
1
10
0 or 1

49) which of these words is used to begin a conditional statement?
when
input
if
unit

50) latoya is creating a program that will teach young children to type. what keyword should be used to create loop that will print "try again" until the correct letter is typed?
else
print
while random

1) the number is not 10

2) while loop
3) indentation
4) chooses a value at random from a string
5) num = random.randint (1,50)
6) be clear and concise
7) while
8) a name error occurs if the variable is referenced before it is declared
9) false
10) keeps track of how many times a loop has executed
11) if, elif, else
12) if and else
13) change == to =
14) false
15) it is ignored
16) true
17) the if statement is false
18) to avoid rambling
19) true
20) elif
21) indentation
22) nod her head and make eye contact
23) repeat a section of code
24) false
25) count-controlled loop
26) the programmer
27) condition-controlled loop
28) a decimal number can be generated
29) variable = null
30) count-controlled loop
31) :
32) if the condition is true
33) :
34) to check whether two pieces of data are actually equal
35) variable = variable + 1
36) conditional statement
37) condition-controlled loop
38) :
39) randint
40) New Validating Techniques
41) set the variable to a beginning value
42) import random
43) while loop
44) score = score + 10
45) tab
46) num == value
47) if, a condition, a colon
48) 0
49) if
50) while