Which of the following are true of Python dictionaries?(can be multiple correct answers)
Anonymous Poll
26%
Items are accessed by their position in a dictionary
67%
Dictionaries are mutable
22%
All the keys in a dictionary must be of the same type
67%
Dictionaries are accessed by key
45%
Dictionaries can be nested to any depth
29%
A dictionary can contain any object type except another dictionary
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Top Java Quiz Questions โ๏ธ
๐๐ฅ๐พ If you want to acquire a solid foundation in Java and/or your goal is to prepare for the exam, this channel is definitely for you.
๐คณFeel free to contact us - @topProQ
If you are interested in Python https://t.me/topPythonQuizQuestions
๐คณFeel free to contact us - @topProQ
If you are interested in Python https://t.me/topPythonQuizQuestions
Code snippet:
x = 10.0
y = (x < 100.0) and isinstance(x, float)
After these are executed, what is the value of y?
Anonymous Quiz
10%
1
13%
None
61%
True
12%
False
5%
0
Code snippet:
d = {'foo': 1, 'bar': 2, 'baz': 3}
while d:
print(d.popitem(), end = '<->')
print('Done.')What is the output of the code snippet above?
Anonymous Quiz
21%
Done.
8%
foo<->bar<->baz
6%
baz<->bar<->foo
18%
baz<->bar<->foo<->Done.
15%
('foo', 3)<->('bar', 2)<->('baz', 1)<->Done.
21%
('baz', 3)<->('bar', 2)<->('foo', 1)<->Done.
11%
The snippet doesnโt generate any output
What will be the value of the i variable when the while loop finishes its execution?
Anonymous Quiz
57%
1
21%
0
7%
2
15%
the variable becomes unavailable
The simplest possible class definition in Python can be expressed as
Anonymous Quiz
17%
class X: return
18%
class X: { }
33%
class X:
32%
class X: pass
Python strings have a property called โimmutability.โ What does this mean?
Anonymous Quiz
10%
Strings in Python can be represented as arrays of chars
69%
Strings in Python canโt be changed
12%
Strings canโt be divided by numbers
10%
You can update a string in Python with concatenation
Which of the following will run without errors?
Anonymous Quiz
55%
round(45.8)
10%
round(6352.898,2,5)
30%
round()
5%
round(7463.123,2,1)
Code snippet:
def example(a):
a = a + '2'
a = a*2
return a
print(example("hello"))
What will be the output of the code snippet above?
Anonymous Quiz
28%
cannot perform mathematical operation on strings
12%
hello2
5%
hello4
54%
hello2hello2
What is the output of the code snippet above?
Anonymous Quiz
4%
0
22%
2.0
38%
2
7%
x
29%
SyntaxError
Code snippet:
from numbers import Number
from decimal import Decimal
from fractions import Fraction
print(isinstance(2.0, Number), end = ' ')
print(isinstance(Decimal('2.0'), Number), end = ' ')
print(isinstance(Fraction(2, 1), Number), end = ' ')
print(isinstance("2", Number), end = ' ')
What is the output of the code snippet above?
Anonymous Quiz
11%
True False True True
18%
True True True True
26%
True False True False
25%
True True True False
11%
False False False False
9%
False True False True
๐ฅ2