67
79k

Python Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Science in Computer Science TY (BSc CS) , Bachelor of Science in Information Technology FY (BSc IT) , Bachelor of Science in Information Technology SY (BSc IT) , Bachelor of Science in Information Technology TY (BSc IT) , Bachelor of Science in Information Technology (BSc IT) .

1.

To read the entire remaining contents of the file as a string from a file object infile, we use ____________

A. infile.readall()
B. infile.read()
C. infile.readlines()
D. infile.read(all)
Answer» B. infile.read()
2.

To access value in tuple, use the ________ bracket for slicing along with the index.

A. square
B. round
C. not necessary
D. triangle
Answer» A. square
3.

What is a variable defined inside a function referred to as?

A. static variable
B. global variable
C. local variable
D. automatic variable
Answer» C. local variable
4.

Which of the following is mathematical function?

A. power
B. sqrt
C. add
D. sub
Answer» B. sqrt
5.

What is the output for the following code:
languages = ["java", "c++", "python"]
for x in languages :
if x == "c++":
continue
print(x)

A. java
B. java python
C. java c++ python
D. c++ python
Answer» B. java python
6.

How many types of geometry manager classes?

A. three
B. two
C. four
D. one
Answer» A. three
7.

Which geometry manager organizes widgets in blocks before placing them in the parent widget.

A. position()
B. grid()
C. pack()
D. place()
Answer» C. pack()
8.

Through Which Geometry method we can organizes widgets in a table-like structure in the parent widget.

A. position()
B. grid()
C. pack()
D. place()
Answer» B. grid()
9.

_____variable is shared by all instances of a class

A. class
B. instance
C. gloabal
D. local
Answer» A. class
10.

Which one of these is floor division

A. /
B. //
C. %
D. none
Answer» B. //

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.