
Ques:- Explain the use of break and continue in python looping ?
Asked In :-
TRICON INFOTECH PVT, SPB, Nalsoft, Juego Studio, CloudIX, VassarLabs, Perceptive Analytics, Vofox Solutions, Zysk Technologies, Aspirant Labs,
Right Answer:
In Python, `break` is used to exit a loop prematurely when a certain condition is met, while `continue` is used to skip the current iteration and move to the next iteration of the loop.
In Python, `break` is used to exit a loop prematurely when a certain condition is met, while `continue` is used to skip the current iteration and move to the next iteration of the loop.
Ques:- In Python what is slicing?
Asked In :-
EY GDS, G S Lab, Vofox Solutions, Fusion Analytics, SpeedLabs, Edgematics, EPIC Semiconductors, adyen, scott logic, nsl,
Ques:- What is module and package in Python?
Asked In :-
Infiniti Software Solutions, Indium Software, ELDAAS Technologies, Vofox Solutions, Propel Technology, Intellipaat Software Solutions, tieto, copart, comparethemarket.com, tiket.com (pt. global tiket network),
Ques:- How to Create APIs in Django ?
Asked In :-
EdgeVerve Systems, Angular Minds, sciative, OSI Digital, Abzooba India Infotech, Vofox Solutions, Polestar Solutions, Softpal, ITGalax Solutions, Adaequare Info Pvt Ltd,
Right Answer:
To create APIs in Django, you can use Django REST Framework (DRF). Here are the steps:
1. **Install Django REST Framework**:
```bash
pip install djangorestframework
```
2. **Add 'rest_framework' to your `INSTALLED_APPS` in `settings.py`**:
```python
INSTALLED_APPS = [
...
'rest_framework',
]
```
3. **Create a Django model** (if you don't have one):
```python
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
```
4. **Create a serializer for the model**:
```python
from rest_framework import serializers
class ItemSerializer(serializers.ModelSerializer):
class Meta:
model = Item
fields = '__all__'
```
5. **Create views for
To create APIs in Django, you can use Django REST Framework (DRF). Here are the steps:
1. **Install Django REST Framework**:
```bash
pip install djangorestframework
```
2. **Add 'rest_framework' to your `INSTALLED_APPS` in `settings.py`**:
```python
INSTALLED_APPS = [
...
'rest_framework',
]
```
3. **Create a Django model** (if you don't have one):
```python
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
```
4. **Create a serializer for the model**:
```python
from rest_framework import serializers
class ItemSerializer(serializers.ModelSerializer):
class Meta:
model = Item
fields = '__all__'
```
5. **Create views for
Ques:- What is MVT and MVC, and how is it related to Django?
Asked In :-
Trigent Software, Infiniti Software Solutions, AppSquadz, Addverb Technologies, EvolveWare, Paktolus, Perceptive Analytics, Gibots, Vofox Solutions, WDS,
Right Answer:
MVT stands for Model-View-Template, and MVC stands for Model-View-Controller. In Django, MVT is a variation of MVC where:
– Model: Represents the data and business logic.
– View: Handles the logic and interacts with the model to retrieve data.
– Template: Manages the presentation layer, rendering the data to the user.
Django uses MVT to separate concerns, similar to how MVC organizes code, but with a focus on templates for rendering HTML.
Ques:- What is rate limiting in APIs and how is it implemented
Asked In :-
Vinove Software & Services Pvt Ltd, Object Frontier Software, Hidden Brains InfoTech, Netaxis IT Solutions (p), Rock Solid Solutions, Shipco IT, Walkover Web Solutions, Solace Infotech, Infinity Labs LLP, TNQ Technologies,
Right Answer:
Rate limiting in APIs is a technique used to control the number of requests a user can make to an API within a specific time period. It is implemented by setting thresholds (e.g., requests per minute) and using mechanisms like tokens, counters, or IP address tracking to monitor and restrict access when the limit is exceeded.
Rate limiting in APIs is a technique used to control the number of requests a user can make to an API within a specific time period. It is implemented by setting thresholds (e.g., requests per minute) and using mechanisms like tokens, counters, or IP address tracking to monitor and restrict access when the limit is exceeded.
Ques:- What is API documentation and why is it necessary
Asked In :-
Vinove Software & Services Pvt Ltd, KRIOS Info Solutions, Queppelin Technology Solutions, Codiant Software Technologies, Born Commerce, Dhruvsoft Services, Oodles Technologies, CakeSoft Technologies, Webvillee Technology, Recodem,
Right Answer:
API documentation is a technical manual that explains how to use an API, including its endpoints, request and response formats, authentication methods, and examples. It is necessary because it helps developers understand how to integrate and interact with the API effectively, ensuring proper usage and reducing errors.
API documentation is a technical manual that explains how to use an API, including its endpoints, request and response formats, authentication methods, and examples. It is necessary because it helps developers understand how to integrate and interact with the API effectively, ensuring proper usage and reducing errors.
Ques:- What are the common status codes in HTTP responses
Asked In :-
DREAMORBIT SOFTECH PVT, Queppelin Technology Solutions, Addweb solutions, Solace Infotech, MatchMove India, QuickXpert Infotech, Recodem, Softcell Technologies, Codebox, scandid,
Right Answer:
The common status codes in HTTP responses are:
- **200**: OK
- **201**: Created
- **204**: No Content
- **400**: Bad Request
- **401**: Unauthorized
- **403**: Forbidden
- **404**: Not Found
- **500**: Internal Server Error
- **502**: Bad Gateway
- **503**: Service Unavailable
The common status codes in HTTP responses are:
- **200**: OK
- **201**: Created
- **204**: No Content
- **400**: Bad Request
- **401**: Unauthorized
- **403**: Forbidden
- **404**: Not Found
- **500**: Internal Server Error
- **502**: Bad Gateway
- **503**: Service Unavailable
Ques:- What are the different types of APIs
Asked In :-
Vinove Software & Services Pvt Ltd, Object Frontier Software, Hidden Brains InfoTech, AnAr Solutions, Netaxis IT Solutions (p), Walkover Web Solutions, Itobuz Technologies, Codiant Software Technologies, Infinity Labs LLP, Define Labs,
Right Answer:
The different types of APIs are:
1. **Open APIs (Public APIs)** - Available to developers and third parties.
2. **Internal APIs (Private APIs)** - Used within an organization.
3. **Partner APIs** - Shared with specific business partners.
4. **Composite APIs** - Combine multiple endpoints into a single call.
5. **Web APIs** - Accessible over the internet using HTTP/HTTPS.
The different types of APIs are:
1. **Open APIs (Public APIs)** - Available to developers and third parties.
2. **Internal APIs (Private APIs)** - Used within an organization.
3. **Partner APIs** - Shared with specific business partners.
4. **Composite APIs** - Combine multiple endpoints into a single call.
5. **Web APIs** - Accessible over the internet using HTTP/HTTPS.
Ques:- What is the difference between GET, POST, PUT, and DELETE in HTTP
Asked In :-
Xoriant Solutions Pvt Ltd, Object Frontier Software, KRIOS Info Solutions, Hidden Brains InfoTech, Shipco IT, Ziffity Solutions, Toxsl Technologies, Itobuz Technologies, Born Commerce, Infinity Labs LLP,
Right Answer:
GET is used to retrieve data from a server, POST is used to send data to a server to create a resource, PUT is used to update an existing resource on the server, and DELETE is used to remove a resource from the server.
GET is used to retrieve data from a server, POST is used to send data to a server to create a resource, PUT is used to update an existing resource on the server, and DELETE is used to remove a resource from the server.