The print function is missing parentheses.
Python is a:
A) Snake hisss hisss
B) Programming language
C) Traffic Cone
B) Programming language.
What kind of variables is var?
var = 12.2
Float
What is the output of the following:
Hello world!
What are the two basic kinds of loops?
For loops and while loops.
Return is indented too much.
Python is:
A) Dynamically Typed
B) Statically Typed
C) Not Typed
A) Dynamically Typed
Name 3 types of variables in Python.
int, long, float, complex, String, boolean
What is the output of the following:
1
When should you use a for loop and when should you use a while loop?
For loop: When you want to repeat a section of code a specific number of times.
While loop: When you do not know how many times you want to repeat a section of code.
The variable "count" does not exist. Capitalization matters!
When was Python first released?
A) 1960's
B) 1970's
C) 1990's
D) 2000's
C) 1990's
What kind of variables is var?
var = '12'
String
Which one of the following happens first?
a) Exponents
b) Addition
c) Multiplication
d) Parentheses
Parentheses
What is the output of the following:
1 2 3 4 5 6
letters[3] does not exist. Indices start at 0, not 1.
Name one of Python's core design philosophies.
What is the proper syntax to add the number 5 to the following list?
nums = [1, 2, 3, 4]
nums = nums + [5]
What is the output of the following?
Error. Needs to have a negative count.
What are x, y, and z in the loop below if we want it to count from 50 down to 10 by 4s?
x = 50
y = 9 (can also be 6, 7, or 8)
z = -4
i will equal 3 then 5 then 7. i does not have enough values for i[3], i[5], or i[7] to be defined, so we get an error.
We should instead use for i in range(len(x)):
Monty Python, the British comedy group.
Fill in the line of code below to complete a function that returns true if the list ends with a 6:
What is the output of the following?
0
2
4
6
8
Given a string and an int n return a larger string that is n copies of the original string.
string_times('Hi', 2) → 'HiHi'
string_times('Hi', 3) → 'HiHiHi'
Fill in the missing code: