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

Problem Solving and Python Programming MCQs | Page - 35

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.

Q. 341) ] test[1] = 'D' del test[2] print(len(test))

(A) 0
(B) 2
(C) error as the key-value pair of 1:’a’ is already deleted
(D) 1
View Answer Discuss Share

Q. 342) print(a)

(A) true
(B) false
(C) ---
(D) ---
View Answer Discuss Share

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

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

Q. 344) To read the remaining lines of the file from a file object infile, we use                          

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

Q. 345) What is the current syntax of remove() a file?

(A) remove(file_name)
(B) remove(new_file_name, current_file_name,)
(C) remove(() , file_name))
(D) none of the mentioned
View Answer Discuss Share

Q. 346) Which of the following mode will refer to binary data?

(A) r
(B) w
(C) +
(D) b
View Answer Discuss Share

Q. 347) Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.

(A) [x in range(1, 1000) if x%3==0]
(B) [x for x in range(1000) if x%3==0]
(C) [x%3 for x in range(1, 1000)]
(D) [x%3=0 for x in range(1, 1000)]
View Answer Discuss Share

Q. 348) Write a list comprehension to produce the list: [1, 2, 4, 8, 16……212].

(A) [(2**x) for x in range(0, 13)]
(B) [(x**2) for x in range(1, 13)]
(C) [(2**x) for x in range(1, 13)]
(D) [(x**2) for x in range(0, 13)]
View Answer Discuss Share

Q. 349) , x is even} (including zero)

(A) [x for x in range(1, 20) if (x%2==0)]
(B) [x for x in range(0, 20) if (x//2==0)]
(C) [x for x in range(1, 20) if (x//2==0)]
(D) [x for x in range(0, 20) if (x%2==0)]
View Answer Discuss Share

Q. 350) , i)]

(A) a list of prime numbers up to 50
(B) a list of numbers divisible by 2, up to 50
(C) a list of non prime numbers, up to 50
(D) error
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