Python GGG
Python GGG
dir()
help()
[2] Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ?
Error
None
25
2
3] Iheritance Supported in Django
Abstract base classes
Multi-table Inheritance
Proxy models
All of the above
19] Why are local variable names beginning with an underscore discouraged?
a) they are used to indicate a private variables of a class
b) they confuse the interpreter
c) they are used to indicate global variables
d) they slow down execution
21] --------- are simple functions (or callables) that take a single argument and
raise ValidationError on invalid input.
Validators
Fields
to_python
22] A________ is a Python script that generally contains import statements, functions, classes
and variable definitions, and Python runnable code and it “lives” file with a ‘.py’ extension.
Set
Class
Module
List
23] Does python Supports Interfaces
Yes
No
def Current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s</body></html>" % now
return HttpResponse(html)
The above code generate a
View
Model
Controller
Template
28] Who developed Python
Dennis Ritchie
Tim Berners Lee
Guido Van Rossum
29] Python extension module that provides efficient operation on arrays of homogeneous data.
NumPy
SciPy
Array
None of These
30] ------ is a process which automatically provide accurate output from the vast amounts of
input data without human intervention and it involves optimizing hyper parameters for an
algorithm or a Machine Learning model to make them perform correctly.
Optimization
Artificial Intelligence
Tuning
[31] The error code used by ValidationError if validation fails. Defaults to "-----
Valid
Invalid
None of these
32] It uses a regular expression to capture URL patterns for processing.
Urls.py
Views.py
Models.py
33] from django.http import HttpResponse
def home(request):
return HttpResponse('Hello, World!')
Result of above program is
Hello World
Page not Found
No output
34] __is a free and open-source web framework written in Python and Based on the
MVT architectural pattern.
Jython
Django
TKinter
35] How is Multithreading achieved in Python?
Python has a multi-threading package but if you want to multi-thread to speed your code
up, then it&
Python has a construct called the Global Interpreter Lock (GIL). The GIL makes sure
that only one of
This happens very quickly so to the human eye it may seem like your threads are
executing in paralle
All of the above
36] How do you perform pattern matching in Python?
using
Regex
Expressions
Validator functions
37] A ----------- is a simple text file. It can create any text-based format like XML, CSV,
HTML, etc.
Template
Model
View
38] The situation where mixins are used:
You want to provide a lot of optional features for a class.
You want to use one particular feature in a lot of different classes.
All of the above
39] Amazon EC2 stands for
Amazon Elastic Compute Cloud forms
Amazon Easy Compute Cloud forms
None of these
40] Backends supported by Django Framework?
MySQL
SQLite
Oracle
All of the above
41] DTL stands for
Django Template Language
Django Templates Language
Django Text Language