Vidyalelo
Python · all questions

Python Built
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

59

Questions

2/3

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following Python function?
oct(7)
oct(‘7’)

Select an option to see the answer and solution.

What is the output of the following code:
my_list = [1, 2, 3, 4]
print(sum(my_list))

Select an option to see the answer and solution.

What will be the output of the following Python functions?
chr(‘97’)
chr(97)

Select an option to see the answer and solution.

What is the output of the following code:
my_list = [5, 8, 2, 6]
print(max(my_list))

Select an option to see the answer and solution.

What will be the output of the following code:
my_string = " Hello, World! "
print(my_string.strip())

Select an option to see the answer and solution.

What will be the output of the following code:
my_string = "Hello, World!"
print(my_string.lower())

Select an option to see the answer and solution.

What will be the output of the following Python function?
complex(1+2j)

Select an option to see the answer and solution.

Which built-in function is used to convert a value to a string?

Select an option to see the answer and solution.

What does the built-in function type() do in Python?

Select an option to see the answer and solution.

What will be the output of the following Python function?
float('   -12345\n')
(Note that the number of blank spaces before the number is 5)

Select an option to see the answer and solution.

Which of the following functions does not throw an error?

Select an option to see the answer and solution.

What will be the output of the following Python function?
len(["hello",2, 4, 6])

Select an option to see the answer and solution.

What is the output of the following code:
my_list = [3, 1, 4, 1]
print(sorted(my_list))

Select an option to see the answer and solution.

Which of the following functions does not necessarily accept only iterables as arguments?

Select an option to see the answer and solution.

What is the output of the following code:
my_list = [1, 2, 3]
print(list(reversed(my_list)))

Select an option to see the answer and solution.

What will be the output of the following Python functions?
float('1e-003')
float('2e+003')

Select an option to see the answer and solution.

What will be the output of the following Python function?
ord(65)
ord(‘A’)

Select an option to see the answer and solution.

What does the built-in function chr() do in Python?

Select an option to see the answer and solution.

What will be the output of the following Python function?
list(enumerate([2, 3]))

Select an option to see the answer and solution.

Which built-in function is used to calculate the length of a sequence like a list or string?

Select an option to see the answer and solution.