Sunday, February 2, 2020

Python Interview Questions

 Image result for python logo
1) In Python what are iterators?
In Python, iterators are used to iterate a group of elements, containers like list. 

2) What is unittest in Python?
A unit testing framework in Python is known as unittest. It supports sharing of setups, automation testing, shutdown code for tests, aggregation of tests into collections etc. 


3) In Python what is slicing?
A mechanism to select a range of items from sequence types like list, tuple, strings etc. is known as slicing. 

4) What are generators in Python?
The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function. 


5) What is docstring in Python?
A Python documentation string is known as docstring, it is a way of documenting Python functions, modules and classes.

No comments:

Post a Comment

Which Python course is best for beginners?

Level Up Your Python Prowess: Newbie Ninjas: Don't fret, little grasshoppers! Courses like "Learn Python 3" on Codecade...