You are on page 1of 8

[1] The ______ function is used to display the defined symbols.

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

4] Why The name python


Developer was a great fan of poisonous reptiles
Developer was a great fan of Monty Python Comedy Series
None of these
5] How would you pronounce Django?
Dejango
Jango
Jang-Oh
6] __________holds key value pairs
List
Tuple
Dictionary
7] Python is Based on the language
PHP
C
ABC
8] Buitlin Database in Django Framework
Sql Server
Sqllite
Sql Server
9] Python has a private____ space to hold all objects and data structures.
Stack
Heap
None of these
10] The following Validator will take inputs
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def validate_even(value):
if value % 2 != 0:
raise ValidationError(
_('%(value)s is not an even number'),
params={'value': value},
)
from django.db import models
class MyModel(models.Model):
even_field = models.IntegerField(validators=[validate_even])
Allows only Even numbers
Allows only odd numbers
Both A and B
None of these
11] Django is stable
Yes
No
12] --------- file: It uses a habitual expression to confine URL patterns for processing.
Urls.py
Models.py
Views.py
13] -------- is a technique where JavaScript on a web page communicates with a server-side
application, re-renders the web page with the result of this communication, all without a web
page transition.
DOM
Ajax
Jython
14] _________is a web microframework for Python.
Flask
Page
Visual Studio
15] Piston Features
Ties into Django's internal mechanisms.
Supports OAuth out of the box (as well as Basic/Digest or custom auth.)
Doesn't require tying to models, allowing arbitrary resources.
All of the above
16] The built in library in python to do Astronomical calculation
EarthPy
SciPy
AstroPy
[17] A ------- is a callable which takes a request and returns a response.
Model
View
Template
18] ------------ verifies a user is who they claim to be
Authentication
Authorization
None of these

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

[20] Ajax Stands for


Associated Javascript and Xml
Asynchronous Javascript and Xml
Automated Javascript and Xsl

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

24] __________allows us to execute multiple threads at once.


Threading
Multiple Threading
None of these

25] _______ is Python library. It is a toolkit for GUI development.


Jython
Tkinter
Tuple
26] You can decorate your actions with a @HCC decorator, which receives ------------required
argument
1
2
3
None of these

27] from django.http import HttpResponse


import datetime

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

42] How to get current page URI in Django template.


{{ request.path }}
{{ request.get_full_path }}
Both a & b
43] Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
44] While Django has its own lightweight web server
Yes
No
45] Who created Django
Adrian Holovaty and Simon Willison
Guido Van Rossum
Tim Berners Lee
46] Python has _______ standard datatypes
8
5
7
6
47] Django web framework is managed and maintained by an independent and non-profit
organization named
Django Software Foundation (DSF).
Centrum Wiskunde & Informatica
Corporation for National Research Initiatives
The session framework helps you in storing and retrieving arbitrary data on a per-site visitor
basis.
Yes
No
49] ____ is used to send data to a server to create/update a resource.
Get
Post
Head
None of these

50] A________is a special kind of multiple inheritances in Python.


Mixin
Interface
None of these

You might also like