Which of the following will correctly convert a string "123" to an integer?
Anonymous Quiz
41%
int(123)
44%
int("123")
9%
str(123)
6%
float("123")
Which function is used to convert a value to a floating-point number in Python?
Anonymous Quiz
10%
int()
5%
str()
82%
float()
3%
bool()
🔥1🤔1
What is the correct way to convert a float 12.34 to an integer in Python?
Anonymous Quiz
11%
float(12.34)
5%
str(12.34)
84%
int(12.34)
0%
bool(12.34)
Which of the following will convert a tuple (1, 2, 3) to a list
Anonymous Quiz
30%
list(1, 2, 3)
27%
tuple([1, 2, 3])
36%
list((1, 2, 3))
7%
str(1, 2, 3)
Are classes can be viewed as factories or templates for constricting to create a new specific objects instances??
Anonymous Quiz
84%
True ✅️
16%
False ❌️
.......... a collection of functions and attributes.
Anonymous Quiz
62%
A-Class
18%
B-Object
21%
C-B & A
0%
Else
for i in range (10):
if i==5:
break else: print (i)
if i==5:
break else: print (i)
Anonymous Quiz
11%
0 1 2 3 4 5 6 7 8 9
11%
1 2 3 4 5
16%
0 1 2 3 4 5
62%
0 1 2 3 4
What is the output of the following code?
x = [1, 2, 3, 4]
print(x[1:3])
x = [1, 2, 3, 4]
print(x[1:3])
Anonymous Quiz
7%
[1, 2]
46%
[2, 3]
19%
[1, 2, 3]
29%
[2, 3, 4]
Which of the following is a valid way to define a Python function?
Anonymous Quiz
80%
def function_name():
9%
function function_name():
7%
function_name def():
3%
define function_name():
How do you create a new list with the values [1, 2, 3]?
Anonymous Quiz
77%
list = [1, 2, 3]
16%
list = (1, 2, 3)
3%
list = {1, 2, 3}
3%
list = 1, 2, 3
Which keyword is used to handle exceptions in Python?
Anonymous Quiz
7%
catch
59%
except
4%
throw
31%
handle
What is the output of the following code?
x = [1, 2, 3]
x.append(4) print(x)
x = [1, 2, 3]
x.append(4) print(x)
Anonymous Quiz
84%
[1, 2, 3, 4]
8%
[1, 2, 3]
3%
[4, 1, 2, 3]
4%
[1, 2, 3, [4]]
Which function is used to get the data type of an object?
Anonymous Quiz
80%
type()
8%
id()
4%
data()
8%
class()