Category: Python
String methods in Python
Naveen
- 0
In Python, a string is a sequence of characters. Strings are used to represent text, and are often used to store and manipulate data. 1 – str.upper(): This method returns a copy of the string with all uppercase letters. For example: 2 – str.lower(): This method returns a copy of the string with all lowercase…
Read MoreWhat is List comprehension and how to use it?
Naveen
- 0
List comprehension is a concise way to create a list using a single line of code. It consists of square brackets containing an expression followed by a for clause, then zero or more for or if clauses. The expressions can be anything, meaning you can put in all kinds of objects in lists. Example 1:…
Read MoreRussia-Ukraine War Data Analysis Project using Python
Naveen
- 0
In this article I will take you through the task of Analyzing the Russia-Ukraine war Dataset using Python. The dataset that I am using for the task of analysis the Ukraine and Russia War is downloaded from Kaggle. You can download russia-ukraine equipment dataset from here and russia-ukraine personnel losses dataset from here. Now let’s import…
Read MorePython Interview Questions – Part 1
Naveen
- 0
1. What is the difference between indexing and slicing? Indexing is the extracting or lookup one or particular values in a data structure, whereas slicing retrieves a sequence of elements. 2. What is the lambda function? Lambda functions are an anonymous or nameless function. These functions are called anonymous because they are not declared in…
Read MoreWhat are Pickling and Unpickling?
Naveen
- 0
Pickling Converting a Python object hierarchy to a byte stream is called pickling. Pickling is also referred to as serialization. Unpickling Converting a byte stream to a python object hierarchy is called unpickling. Unpickling is also referred to as deserialization. Popular Posts
Read MoreWhat Advantage does the NumPy Array have over a nested list?
Naveen
- 0
NumPy is written in C so that all its complexities are backed into a simple to use a module. Lists, on the other hand, the dynamically typed. Therefore, Python must check the data type of each element every time it uses it. This makes NumPy arrays much faster than lists. NumPy has a lot od…
Read MoreDjango Architecture in Python
Naveen
- 0
Django is a web service used to build your web pages. Its architecture is as shown: Template: the front end of the web page. Model: the back end where the data is stored. View: it interacts with the model and template and maps it to the URL. Django: serves the page to the user. Popular…
Read MoreHow is Multithreading Achieved in Python?
Naveen
- 0
Multithreading usually implies that multiple threads are executed concurrently. The Python Global Interpreter Lock doesn’t allow more than one thread to hold the Python interpreter at that particular point of time. So, multithreading in python is achieved through context switching. It is quite different from multiprocessing which actually opens up multiple across multiple threads. Popular…
Read MoreWhat is the difference Between a Shallow Copy and Deep Copy?
Naveen
- 0
Deepcopy Deepcopy creates a different object and populates it with the child objects of the original object. Therefore, changes in the original object are not reflected in the copy. copy.deepcopy() creates a Deep Copy. Shallow copy Shallow copy creates a different object and populates it with the references of the child objects within the original…
Read MoreWhat are Literals in Python and explain about different Literals?
Naveen
- 0
A literal in python source code represents a fixed value for primitive data types. There are 5 types of literals in Python- String literals A string literal is created by assigning some text enclosed in single of double quotes to a variable. To create multiline literals, assign the multiline text enclosed in triple quotes. E.g.,…
Read More