CS 1400 EXAM 2 QUESTIONS WITH VERIFIED ANSWERS
Correct 44
Incorrect 00
1
2 f 44
Term
What is the first thing to print in this program?
def display_1():
print("Go Aggies!")
def display_2():
print("Utah State!")
print("School Pride")
display_2()
display_1()
Give this one a try later!
, School Pride To come up with a solution to the
problem
*The functions will not print until To think through the problem
you call them, which happens at
the end of this program. To make coding simpler
range(len(my_list))
Your birthday is in July
*Index is always one off
*will print the length of the list (6)
Don't know?
3 of 44
Term
Mark all that are valid import statements to use a module. You may
assume that all names used are valid.
Give this one a try later!
1
5
3 import mathy
from mathy import calc
*Will print a random integer between
1 and 5
, 12 4
*will run 3 times in j, 4 times in i *Counting by 3 from 1-12
Don't know?
4 of 44
Term
In python, what does a function with no explicit return statement
return?
Give this one a try later!
A convention None object
class Widget:
Pseudocode
pass
Don't know?
5 of 44
Definition
var_4, var_6, var_3, var_7, var_5
Give this one a try later!
, Put the following arguments in the correct spot to produce the output.
The giant captured 12 ducks.
def message(var_1, var_2, var_3):
print("The " + var_2 + " captured " + str(var_3) + " " + var_1 + "s.")
var_4 = "duck"
var_5 = 12
var_6 = "giant"
message(_____, _____, __ )
Put the following arguments in the correct spot to produce the output.
12 hungry hippos tickled the panda
def message(_____, _____, _ ):
print(str(var_3) + " hungry " + var_1 + "s tickled the " + var_2)
var_4 = "panda"
var_5 = "hippo"
var_6 = 12
message(var_4, var_5, var_6)
Put the following arguments in the correct spot to produce the output.
The chickens ate 12 of the 19 donuts.
def message( ____ , var_3, var_1, var_2):
print("The " + var_1 + "s ate " + str(var_2) + " of the " + str(var_3) + " " + var_4 + ".")
var_5 = "chicken"
var_6 = 12
var_7 = 19
Correct 44
Incorrect 00
1
2 f 44
Term
What is the first thing to print in this program?
def display_1():
print("Go Aggies!")
def display_2():
print("Utah State!")
print("School Pride")
display_2()
display_1()
Give this one a try later!
, School Pride To come up with a solution to the
problem
*The functions will not print until To think through the problem
you call them, which happens at
the end of this program. To make coding simpler
range(len(my_list))
Your birthday is in July
*Index is always one off
*will print the length of the list (6)
Don't know?
3 of 44
Term
Mark all that are valid import statements to use a module. You may
assume that all names used are valid.
Give this one a try later!
1
5
3 import mathy
from mathy import calc
*Will print a random integer between
1 and 5
, 12 4
*will run 3 times in j, 4 times in i *Counting by 3 from 1-12
Don't know?
4 of 44
Term
In python, what does a function with no explicit return statement
return?
Give this one a try later!
A convention None object
class Widget:
Pseudocode
pass
Don't know?
5 of 44
Definition
var_4, var_6, var_3, var_7, var_5
Give this one a try later!
, Put the following arguments in the correct spot to produce the output.
The giant captured 12 ducks.
def message(var_1, var_2, var_3):
print("The " + var_2 + " captured " + str(var_3) + " " + var_1 + "s.")
var_4 = "duck"
var_5 = 12
var_6 = "giant"
message(_____, _____, __ )
Put the following arguments in the correct spot to produce the output.
12 hungry hippos tickled the panda
def message(_____, _____, _ ):
print(str(var_3) + " hungry " + var_1 + "s tickled the " + var_2)
var_4 = "panda"
var_5 = "hippo"
var_6 = 12
message(var_4, var_5, var_6)
Put the following arguments in the correct spot to produce the output.
The chickens ate 12 of the 19 donuts.
def message( ____ , var_3, var_1, var_2):
print("The " + var_1 + "s ate " + str(var_2) + " of the " + str(var_3) + " " + var_4 + ".")
var_5 = "chicken"
var_6 = 12
var_7 = 19