Python Question and Answers – Datetime Module – 1

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Datetime Module – 1”. 1. What will be the output of the following Python code? import datetime d=datetime.date(2016,7,24) print(d) a) Error b) 2017-07-24 c) 2017-7-24 d) 24-7-2017 2. What will be the output of the following Python code? import datetime d=datetime.date(2017,06,18) print(d) a) … Read more

advertisement

Python Questions and Answers – Math – 3

This set of Python Developer Questions & Answers focuses on “Math – 3”. 1. What is the result of math.trunc(3.1)? a) 3.0 b) 3 c) 0.1 d) 1 2. What is the output of print(math.trunc(‘3.1’))? a) 3 b) 3.0 c) error d) none of the mentioned 3. Which of the following is the same as … Read more

advertisement

Python Questions and Answers – Math – 2

This set of Python Developer Questions & Answers focuses on “Mathematical Functions”. 1. What does the function math.frexp(x) return? a) a tuple containing the mantissa and the exponent of x b) a list containing the mantissa and the exponent of x c) a tuple containing the mantissa of x d) a list containing the exponent … Read more

advertisement

Python Multiple Choice Questions – Math

This set of Python Objective Questions & Answers focuses on “Math”. 1. What is returned by math.ceil(3.4)? a) 3 b) 4 c) 4.0 d) 3.0 2. What is the value returned by math.floor(3.4)? a) 3 b) 4 c) 4.0 d) 3.0 3. What will be the output of print(math.copysign(3, -1))? a) 1 b) 1.0 c) … Read more

advertisement

Python Questions and Answers – Python Modules

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Python Modules”. 1. Which of these definitions correctly describes a module? a) Denoted by triple quotes for providing the specification of certain program elements b) Design and implementation of specific functionality to be incorporated into a program c) Defines the specification of how … Read more

advertisement

Python Questions and Answers – Mapping Functions – 3

This set of Python Questions and Answers focuses on “Mapping Functions”. 1. 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 2. What will be the output of the following Python code? x = [[0], [1]] print((’ … Read more

advertisement

Python Questions and Answers – Mapping Functions – 2

This set of Tough Python Questions & Answers focuses on “Mapping Functions”. 1. What will be the output of the following Python code? x = [’ab’, ‘cd’] print(len(list(map(list, x)))))) a) 2 b) 4 c) error d) none of the mentioned 2. What will be the output of the following Python code? x = [’ab’, ‘cd’] … Read more

advertisement

Python Multiple Choice Questions – Mapping Functions

This set of Python Interview Questions & Answers focuses on “Mapping Functions”. 1. What will be the output of the following Python code? elements = [0, 1, 2] def incr(x): return x+1 print(list(map(elements, incr))) a) [1, 2, 3] b) [0, 1, 2] c) error d) none of the mentioned 2. What will be the output … Read more

advertisement

Python Questions and Answers – Functional Programming Tools

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Functional Programming Tools”. 1. What will be the output of the following Python code? odd=lambda x: bool(x%2) numbers=[n for n in range(10)] print(numbers) n=list() for i in numbers: if odd(i): continue else: break a) [0, 2, 4, 6, 8, 10] b) [0, 1, … Read more

advertisement

Python Questions and Answers – Shallow copy vs Deep copy

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Shallow copy vs Deep copy”. 1. Which type of copy is shown in the following python code? l1=[[10, 20], [30, 40], [50, 60]] ls=list(l1) ls [[10, 20], [30, 40], [50, 60]] a) Shallow copy b) Deep copy c) memberwise d) All of the … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.