No Result
View All Result
Sunday, September 24, 2023
  • Login
Getting Placed
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship
No Result
View All Result
Getting Placed
No Result
View All Result

Python MCQ’s on Mapping Functions: SET 3

Abhishek by Abhishek
April 28, 2021
in Python
0
python

 

21. What will be the output of the following Python code?

x = [[0], [1]]

print((‘ ‘.join(list(map(str, x)))))

a) (‘[0] [1]’,)

b) (’01’,)

c) [0] [1]

d) 01

Check Answer

Answer: c
(element) is the same as element. It is not a tuple with one item.

22. What will be the output of the following Python code?

x = [[0], [1]]

print((‘ ‘.join(list(map(str, x))),))

a) (‘[0] [1]’,)

b) (’01’)

c) [0] [1]

d) 01

Check Answer

Answer: a
(element,) is not the same as element. It is a tuple with one item.

23. What will be the output of the following Python code?

x = [34, 56]

print((”.join(list(map(str, x))),))

a) 3456

b) (3456)

c) (‘3456’)

d) (‘3456’,)

Check Answer

Answer: d
We have created a tuple with one string in it.

24. What will be the output of the following Python code?

x = [34, 56]

print((”.join(list(map(str, x)))),)

a) 3456

b) (3456)

c) (‘3456’)

d) (‘3456’,)

Check Answer

Answer: a
We have just created a string.

25. What will be the output of the following Python code?

x = [34, 56]

print(len(map(str, x)))

a) [34, 56]

b) [’34’, ’56’]

c) 34 56

d) error

Check Answer

Answer: d
TypeError, map has no len.

26. What will be the output of the following Python code?

x = ‘abcd’

print(list(map(list, x)))

a) [‘a’, ‘b’, ‘c’, ‘d’]

b) [‘abcd’]

c) [[‘a’], [‘b’], [‘c’], [‘d’]]

d) none of the mentioned

Check Answer

Answer: c
list() is performed on each character in x.

27. What will be the output of the following Python code?

x = abcd

print(list(map(list, x)))

a) [‘a’, ‘b’, ‘c’, ‘d’]

b) [‘abcd’]

c) [[‘a’], [‘b’], [‘c’], [‘d’]]

d) none of the mentioned

Check Answer

Answer: d
NameError, we have not defined abcd.

28. What will be the output of the following Python code?

x = 1234

print(list(map(list, x)))

a) [1, 2, 3, 4]

b) [1234]

c) [[1], [2], [3], [4]]

d) none of the mentioned

Check Answer

Answer: d
TypeError, int is not iterable.

29. What will be the output of the following Python code?

x = 1234

print(list(map(list, [x])))

a) [1, 2, 3, 4]

b) [1234]

c) [[1], [2], [3], [4]]

d) none of the mentioned

Check Answer

Answer: d
TypeError, int is not iterable.

30. What will be the output of the following Python code?

x = ‘abcd’

print(list(map([], x)))

a) [‘a’, ‘b’, ‘c’, ‘d’]

b) [‘abcd’]

c) [[‘a’], [‘b’], [‘c’], [‘d’]]

d) none of the mentioned

Check Answer

Answer: d
TypeError, list object is not callable.

31. Is Python code compiled or interpreted?

a) Python code is only compiled

b) Python code is both compiled and interpreted

c) Python code is only interpreted

d) Python code is neither compiled nor interpreted

Check Answer

Answer: b
Many languages have been implemented using both compilers and interpreters, including C, Pascal, and Python.

32. Which of these is the definition for packages in Python?

a) A folder of python modules

b) A set of programs making use of Python modules

c) A set of main modules

d) A number of files containing Python definitions and statements

Check Answer

Answer: a
A folder of python programs is called as a package of modules.

33. Which of these is false about a package?

a) A package can have subfolders and modules

b) Each import package need not introduce a namespace

c) import folder.subfolder.mod1 imports packages

d) from folder.subfolder.mod1 import objects imports packages

Check Answer

Answer: b
Explanation: Packages provide a way of structuring Python namespace. Each import package introduces a namespace.

Page  1  2  3

Python Interview Questions (MCQs)

We have divided these Python Questions and Answers into various parts based on the topics. Open the Topic of your choice and Practice these MCQs.

Python MCQs on Variables and Operators Python MCQs on Precedence and Associativity
Python MCQs on Data Type Python MCQs on Boolean
Python MCQs on Bitwise Operators Python MCQs on Formatting and Advance Formatting
Python MCQs on Decorators Python MCQs on While and For Loops
Python MCQs on List Python MCQs on List Comprehension
Python MCQs on String Python MCQs on Tuple
Python MCQs on SET Python MCQs on Dictionary
Python MCQs on Functions Python MCQs on Argument Parsing
Python MCQs on Global and Local Variables Python MCQs on Recursion
Python MCQs on Mapping Functions Python MCQs on Modules
Python MCQs on Regular Expressions Python MCQs on Files
Python MCQs on Overloading Python MCQs on Classes and Objects
Python MCQs on Inheritance Python MCQs on Polymorphism and Encapsulation
Python MCQs on Exception Handling
Previous Post

Python MCQs on Argument Parsing: SET 2

Next Post

Python MCQs on Decorators

Abhishek

Abhishek

Next Post
python

Python MCQs on Decorators

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us on Google News
No Result
View All Result

Recent Posts

  • Mustard Oil Price: सस्ता हुआ सरसों का तेल, खरीदने वालों की लगी भीड़
  • Bhojpuri Video: पवन सिंह ने रात के अंधेरे में मोनालिसा के बदन पर फेरा हाथ, मच गया बवाल
  • Gori Nagori ने उछल-उछल कर तोड़ दिया स्टेज, लगाए ताबड़तोड़ ठुमके
  • Haryanvi Dance: भरी जवानी में Gori Nagori के लगाए लटके-झटकें, देख बूढ़ों में आया जोश
  • Gori Nagori ने स्टेज पर उछल उछल कर लगाए जोरदार ठुमके, वायरल हुआ वीडियो

Recent Comments

  • Abhishek on Win 11 Download Links

Archives

  • September 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • August 2022
  • July 2022
  • October 2021
  • July 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • April 2020
  • February 2020

Categories

  • Admit Card
  • Algorithm and Programs
  • Exam
  • Internship
  • Java
  • Jobs
  • latest
  • politics and entertainment
  • Python
  • Result
  • Trademark
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Privacy Policy
  • DMCA
  • Terms of Use
  • Sitemap

© 2020 Getting Placed

No Result
View All Result
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship

© 2020 Getting Placed

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In