All quizzesEasy
Core Concepts — Series 3
Preview — 3 of 10 questions
What is the output of the following code?
javascript
print(3 + 2.0)
print(type(3 + 2.0))
print(10 / 5)
print(type(10 / 5))
print(10 // 5)
print(type(10 // 5))A5.0, <class 'float'>, 2.0, <class 'float'>, 2, <class 'int'>
B5.0, <class 'float'>, 2, <class 'int'>, 2, <class 'int'>
C5.0, <class 'float'>, 2.0, <class 'float'>, 2.0, <class 'float'>
D5, <class 'int'>, 2, <class 'int'>, 2, <class 'int'>
What is the output of the following code?
javascript
s = "hi"
print(str(s))
print(repr(s))
print(str(None))
print(repr(None))A'hi', 'hi', None, None
Bhi, 'hi', None, None
Chi, hi, None, None
Dhi, 'hi', None, 'None'
What is the output of the following code?
javascript
r = range(5)
print(r)
print(type(r))
print(list(r))
print(r[2])
print(len(r))Arange(5), <class 'range'>, [0, 1, 2, 3, 4], 2, 5
B[0, 1, 2, 3, 4], <class 'list'>, [0, 1, 2, 3, 4], 2, 5
Crange(0, 5), <class 'range'>, [0, 1, 2, 3, 4], 2, 5
Drange(0, 5), <class 'range'>, [0, 1, 2, 3, 4], TypeError, 5
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.