Kahooot
What is the result of print('5'+'3')
'53'
What will the code evaluate to? fruits1 = {'orange', 'apple', 'banana'} fruits2={'banana', 'kiwi', 'manga'} fruits1 & fruits2
{'banana'}
What will the code evaluate to? x = [1,2,3] y = [4,5,6] foo = dict(zip(x,y)) print(foo)
{1:4, 2:5, 3:6}
What will the code evaluate? {x: x**2 for x in (2,4,6)}
{2:4, 4:16, 6:36}
What will the code evaluate? fruits = ['orange', 'apple', 'banana', 'banana'] fruits.pop(0)
'orange'
What values will be included in this range? range(-10, -100, -30)
-10, -40, -70
What is the result of print(5//2)
2
What will the code evaluate to? fruits=['orange', 'apple', 'banana', 'banana'] fruits.index('banana')
2
What is the result of print(5/2)
2.5
What will the code evaluate to? scores = [1,2,3,4,5] averageScores = sum(scores) / len(scores) print(averageScores)
3.0
What decorator would you use on a class method?
@property
What makes sets different from other data structures?
Each element is unique
What does it mean that a dictionary is a mappable collection?
Elements are referenced with a hashable value
Who invented Python?
Guido Van Rossum
Why is the language called Python?
Monty Python's Flying Circus
What will the code evaluate to? empty_titles = [] print(all(empty_titles))
True
What will the code evaluate to? feedback=['Good', '', ' '] print(any(feedback))
True
What is the result of print(int('43.0'))
ValueError
What will the code evaluate? squares = [x**2 for x in range(5)] print(squares)
[0,1,4,9,16]
What will the code below evaluate? squares = [1,4,9,15,26] squares[-3:]
[9,15,26]
What will the code evaluate? scores = [90,86,75,91,62,99,88,90] def isA(num): return num >= 90 aScores = filter(isA, scores) print(list(aScores))
[90,91,99,90]
Which command will correctly ask the user for their age? a. age = input('How old are you?') b. input('How old are you?') = name c. age= input(how old are you?) d. How old are you = input()
age = input('How old are you?')
What 2 paramenters does the built-in function filter() take?
filter(function, iterable)
What keywords can be used in an if statement?
if, elif, else