1/34
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is the variable type of 16/4?
int (integer)
What is the variable type of 5.5 > 4?
bool (boolean)
What is the variable type of drinksCoffee?
str (string)
What is the variable type of favorite[2:]?
str (string)
What is the variable type of favorite.index('i')?
int (integer)
What is the variable type of desserts[1]?
str (string)
What is the variable type of desserts[2:3]?
list
What is the variable type of 'pie' in desserts?
bool (boolean)
What is the variable type of menu['espresso']?
float (floating point number)
What is the variable type of file.readline()?
str (string)
True or False: The constructor (dunder init) method returns a value.
False
True or False: Lists are a type of sequence in Python.
True
True or False: Python is a low-level programming language.
False
True or False: Dictionary keys must be immutable and unique.
True
True or False: Each if statement can have an unlimited number of elif statements.
True
What is the value of favorites?
['pencil', 'binder', 'eraser']
What is the value of num?
4
How do you add 'folder' to supplies?
supplies.append('folder')
How do you flip the order of supplies?
supplies.reverse()
How do you add 'ruler' after 'pencil' in supplies?
supplies.insert(2, 'ruler')
What is the correct way to create a for loop to print supplies?
for item in supplies: print(item + ' is required for class')
How do you convert supplies to a string with '*' separator?
newString = '*'.join(supplies)
What is the value of len(villagers)?
6
How do you correctly access Diva's hobby?
villagers[3]['hobby']
How do you add newNeighbor to villagers?
villagers.append(newNeighbor)
How do you delete Eunice's dictionary from villagers?
villagers.remove({'name':'Eunice', 'personality':'normal', 'pet':'sheep', 'hobby':'fashion'})
How do you generate a random even number from 20 to 30?
num = random.choice(range(20, 31, 2))
How many parameters does the userChoice function have?
1
What is the condition for the while loop in userChoice?
userInput not in options
How do you create a main function that calls userChoice?
def main(): userChoice()
What is the first error in the Pig Latin program?
Line 3: Change 'if word[0] == vowels:' to 'if word[0] in vowels:'
What is the second error in the Pig Latin program?
Line 5: Remove the colon after 'elif'
What is the third error in the Pig Latin program?
Line 10: Change 'lower' to 'lower()'
What is the fourth error in the Pig Latin program?
Line 15: Change 'pigLatinList = pigLatinList.append(pigLatinWord)' to 'pigLatinList.append(pigLatinWord)'
What is the fifth error in the Pig Latin program?
Line 21: Change 'messageToTranslate[]' to 'messageToTranslate()'