Python 3 MCQ (SET-12) – Multiple Choice Questions and Answers

What will be the output after the following statements? x = {‘year’: 2016, ‘month’: ‘March’} x.setdefault(‘day’, ‘Tuesday’) x.setdefault(‘day’, ‘Monday’) print(x) a. (‘day’, ‘Monday’) b. {‘day’: ‘Monday’, ‘month’: ‘March’} c. {‘day’: ‘Tuesday’, ‘month’: ‘March’, ‘year’: 2016} d. {‘day’: ‘Monday’, ‘month’: ‘March’, ‘year’: 2016} What will be the data type of x after the following statement? x … Read more

Python 3 MCQ (SET-10) – Multiple Choice Questions and Answers

What will be the output after the following statements? a = list(range(-10,5,2)) print(sum(a)) a. -24 b. 0 c. 24 d. 20 What will be the output after the following statements? x = [5, 4, 3, 2, 1] y = x.copy() x[0] = 6 print(y) a. [6, 4, 3, 2, 1] b. 6 c. [5, 4, … Read more

Python 3 MCQ (SET-9) – Multiple Choice Questions and Answers

What will be the output after the following statements? x = [int(i**3/3) for i in range(0,5,2)] print(x) a. [0, 2, 36] b. [0, 2, 21] c. [0, 6, 2] d. [0, 2, 14] What will be the output after the following statements? x = [int(i/2-5) for i in range(3,8,2)] print(x) a. [-3, -2, -1] b. … Read more

Python 3 MCQ (SET-8) – Multiple Choice Questions and Answers

What is the name of Python’s built-in module for mathematical statistics functions? a. mathstats b. statistics c. statmath d. statfunc What is the name of Python’s built-in module for subprocess management? a. sub b. mansub b. mansub c. submng d. subprocess What is the name of Python’s built-in module for Python’s configuration information? a. config … Read more

Python 3 MCQ (SET-7) – Multiple Choice Questions and Answers

What will be the output after the following statements? b = 3 for a in range(10, 1): b -= a + 1 print(b) a. 7 b. 4 c. 3 d. 8 What will be the output after the following statements? b = 1 for a in range(1, 5): b *= a + 1 print(b) a. … Read more

Python 3 MCQ (SET-6) – Multiple Choice Questions and Answers

What will be the output after the following statements? x = ‘2.7’ print(x.isdecimal()) a. True b. False c. 1 d. 0 What does the following statement do? x = open(‘python.csv’, ‘r’) a. Opens an existing text file named python.csv to write b. Opens an existing text file named python.csv to append c. Opens an existing … Read more

Python 3 MCQ (SET-5) – Multiple Choice Questions and Answers

What does the following statements do?from datetime import *print(datetime.today().strftime(‘%x’))a. Displays the time appropriate for localeb. Displays the current year as 00 to 99c. Displays the current year as 0001 to 9999d. Displays the date appropriate for locale What does the following statements do?from datetime import *print(datetime.today().strftime(‘%X’))a. Displays the current year as 0001 to 9999b. Displays … Read more

Python 3 MCQ (SET-4) – Multiple Choice Questions and Answers

What is printvar in the following statements? myvar = 5 def printvar() : print(myvar) printvar() a. A list b. A string c. An integer d. A function What will be the output after the following statements? myvar = 5 def printvar() : print(myvar, end =”) printvar() printvar() a. 55 b. 5 5 c. 5 d. … Read more

Python 3 MCQ (SET-3) – Multiple Choice Questions and Answers

What will be the output after the following statements? x = {0:4, 1:8, 2:16, 3:32} print(list(x.values())[2]) a. [4, 8] b. [4, 8, 16] c. 16 d. 8 What will be the output after the following statements? x = {0:4, 1:8, 2:16, 3:32} print(x.items()) a. dict_items(4, 8, 16, 32) b. dict_items([4, 8, 16, 32]) c. dict_items[0, … Read more

Python 3 MCQ (SET-1) – Multiple Choice Questions and Answers

Which of the following version of Python was released in December, 2015 byPython.org?a. 3.3b. 3.5.1c. 2.4d. 2.6 Python files are saved with the extension as …?a. .pythonb. .pec. .pyd. .pi What is the name of the GUI that comes in-built as an interactive shell withPython?a. PGUIb. Pyshellc. IDLEd. PythonSh IDLE stands for … ?a. Indigenous … Read more