Python Interview Questions
1 .
How Python is interpreted?
2 .
Mention what is Flask-WTF and what are their features?
Flask-WTF offers simple integration with WTForms. Features include for Flask WTF are Integration with wtforms Secure form with csrf token Global csrf protection Internationalization integration Recaptcha supporting File upload that works with Flask Uploads
3 .
How can I find methods or attributes of an object in Python?
Built­in dir() function of Python ,on an instance shows the instance variables as
well as the methods and class attributes defined by the instance’s class and all its base classes alphabetically. So by any object as argument to dir() we can find all the methods & attributes of the object’s class
4 .

5 .
What is Polymorphism in Python?
Polymorphism means the ability to take multiple forms. So, for instance, if the parent class has a method named ABC then the child class also can have a method with the same name ABC having its own parameters and variables. Python allows polymorphism.
6 .
What Is %S In Python?
Python has support for formatting any value into a string. It may contain quite complex expressions.
One of the common usages is to push values into a string with the %s format specifier. The formatting operation in Python has the comparable syntax as the C function printf() has.speed
7 .
What Is The Set Object In Python?
Sets are unordered collection objects in Python. They store unique and immutable objects. Python has its implementation derived from mathematics.
8 .
What Is The Difference Between An Iterator And Iterable?
The collection type like a list, tuple, dictionary, and set are all iterable objects whereas they are also iterable containers which return an iterator while traversing.
9 .
How Do You Delete Elements Of A Dictionary In Python?
We can delete a key in a dictionary by using the del() method.
>>> site_stats = {'site': '', 'traffic': 10000, "type": "organic"}
>>> del site_stats["type"]
>>> print(site_stats)
{'site': '', 'traffic': 1000000}

Another method, we can use is the pop() function. It accepts the key as the parameter. Also, a second parameter, we can pass a default value if the key doesn’t exist.
>>> print(site_stats.pop("type", None))
>>> print(site_stats)
{'site': '', 'traffic': 10000}
10 .
How Do You Write A Conditional Expression In Python?
We can utilize the following single statement as a conditional expression. default_statment if Condition else another_statement
>>> no_of_days = 366
>>> is_leap_year = "Yes" if no_of_days == 366 else "No"
>>> print(is_leap_year)