Home / Engineering / Problem Solving and Python Programming MCQs / Page 29

Problem Solving and Python Programming MCQs | Page - 29

Dear candidates you will find MCQ questions of Problem Solving and Python Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.

M

Mr. Dubey • 51.32K Points
Coach

Q. 281) ,9))

(A) 9
(B) 3
(C) too many arguments for pop() method
(D) 4
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 282) Which of the statements about dictionary values if false?

(A) more than one key can have the same value
(B) the values of the dictionary can be accessed as dict[key]
(C) values of a dictionary must be unique
(D) values of a dictionary can be a mixture of letters and numbers
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 283) If a is a dictionary with some key-value pairs, what does a.popitem() do?

(A) removes an arbitrary element
(B) removes all the key-value pairs
(C) removes the key-value pair for the key given as an argument
(D) invalid method for dictionary
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 284) ][1])

(A) [2,3,4]
(B) 3
(C) 2
(D) an exception is thrown
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 285) ,2,3],"check")

(A) syntax error
(B) {1:”check”,2:”check”,3:”check”}
(C) “check”
(D) {1:none,2:none,3:none}
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 286) If b is a dictionary, what does any(b) do?

(A) returns true if any key of the dictionary is true
(B) returns false if dictionary is empty
(C) returns true if all keys of the dictionary are true
(D) method any() doesn’t exist for dictionary
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 287) To open a file c:\scores.txt for writing, we use                          

(A) outfile = open(“c:\\scores.txt”, “w”)
(B) outfile = open(“c:\\scores.txt”, “w”)
(C) outfile = open(file = “c:\\scores.txt”, “w”)
(D) outfile = open(file = “c:\\scores.txt”, “w”)
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 288) To open a file c:\scores.txt for appending data, we use                          

(A) outfile = open(“c:\\scores.txt”, “a”)
(B) outfile = open(“c:\\scores.txt”, “rw”)
(C) outfile = open(file = “c:\\scores.txt”, “w”)
(D) outfile = open(file = “c:\\scores.txt”, “w”)
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 289) Which of the following statements are true?

(A) when you open a file for reading, if the file does not exist, an error occurs
(B) when you open a file for writing, if the file does not exist, a new file is created
(C) when you open a file for writing, if the file exists, the existing file is overwritten with the new file
(D) all of the mentioned
View Answer Discuss Share

M

Mr. Dubey • 51.32K Points
Coach

Q. 290) 1 TEXT FILES, READING AND WRITING FILES, FORMAT OPERATOR

(A) infile.read(2)
(B) infile.read()
(C) infile.readline()
(D) infile.readlines()
View Answer Discuss Share

Explore Sets

Problem Solving and Python Programming MCQs Set 1

Problem Solving and Python Programming MCQs Set 2

Problem Solving and Python Programming MCQs Set 3

Problem Solving and Python Programming MCQs Set 4

Problem Solving and Python Programming MCQs Set 5

Problem Solving and Python Programming MCQs Set 6

Problem Solving and Python Programming MCQs Set 7

Problem Solving and Python Programming MCQs Set 8

Problem Solving and Python Programming MCQs Set 9

Problem Solving and Python Programming MCQs Set 10

Problem Solving and Python Programming MCQs Set 11

Problem Solving and Python Programming MCQs Set 12

Problem Solving and Python Programming MCQs Set 13

Problem Solving and Python Programming MCQs Set 14

Problem Solving and Python Programming MCQs Set 15

Problem Solving and Python Programming MCQs Set 16

Problem Solving and Python Programming MCQs Set 17

Problem Solving and Python Programming MCQs Set 18

Problem Solving and Python Programming MCQs Set 19

Problem Solving and Python Programming MCQs Set 20

Problem Solving and Python Programming MCQs Set 21

Problem Solving and Python Programming MCQs Set 22

Problem Solving and Python Programming MCQs Set 23

Problem Solving and Python Programming MCQs Set 24

Problem Solving and Python Programming MCQs Set 25

Problem Solving and Python Programming MCQs Set 26

Problem Solving and Python Programming MCQs Set 27

Problem Solving and Python Programming MCQs Set 28

Problem Solving and Python Programming MCQs Set 29

Problem Solving and Python Programming MCQs Set 30

Problem Solving and Python Programming MCQs Set 31

Problem Solving and Python Programming MCQs Set 32

Problem Solving and Python Programming MCQs Set 33

Problem Solving and Python Programming MCQs Set 34

Problem Solving and Python Programming MCQs Set 35

Problem Solving and Python Programming MCQs Set 36

Problem Solving and Python Programming MCQs Set 37

Problem Solving and Python Programming MCQs Set 38

Problem Solving and Python Programming MCQs Set 39

Problem Solving and Python Programming MCQs Set 40

Problem Solving and Python Programming MCQs Set 41

Problem Solving and Python Programming MCQs Set 42

Problem Solving and Python Programming MCQs Set 43