Akshitha Mote has Published 55 Articles

Accumulator battery in Python

Akshitha Mote

Akshitha Mote

Updated on 22-Jul-2025 18:50:00

312 Views

Problem Statement Consider a mobile phone, which is in "eco mode". This mode activates once your battery level reaches 20 percent. In this eco mode, the battery drains two times slower than in normal mode. This means that, in normal mode, if the time consumed by the battery is 1% ... Read More

How to Create Acronyms from Words Using Python

Akshitha Mote

Akshitha Mote

Updated on 22-Jul-2025 18:40:42

3K+ Views

The acronym is an abbreviated version of a sentence, which means it is the short form of the given sentence. It is formed from each word's first character in the given sentence. For example, CPU is an acronym of Central Processing Unit. In this article, we will learn how to ... Read More

Python program for removing n-th character from a string?

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 19:30:06

1K+ Views

The problem statement is to remove the nth character from the given string. Let's understand with an example. Consider my_string = "Tutorialspoint". The given value of n is 6; then we need to remove the 5th character from the string. Because the index value starts from zero. And it should ... Read More

How to get the size of a list in Python?

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 19:20:39

6K+ Views

In Python, a list is an ordered sequence that can hold several object types, such as integers, characters, or floats. In other programming languages, a list is equivalent to an array. In this article, we need to determine the size of a list, which refers to its length. For instance, ... Read More

How to return an object from a function in Python?

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 17:33:43

16K+ Views

In Python, we can return an object from a function, using the return keyword, just like any other variable. The statements after the return will not be executed. The return keyword cannot be used outside the function. If the function has a return statement without any expression, then the special value ... Read More

Python program for Modular Exponentiation

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 17:26:07

811 Views

What is Modular Exponentiation? To calculate Modular exponentiation, we need to raise a base to an exponent and then calculate the modulus of the result. This includes 3 integers: base, exponent, and modulo. Following is the syntax of the modular exponentiation in Python - (base**exponent) % modulo For instance, ... Read More

Create Word Cloud using Python

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 17:12:23

1K+ Views

A "word cloud" is a visual representation of text data, where the size of each word indicates its frequency or importance within the dataset. It helps us to identify the most common and important words in a text. It is typically used to describe/denote big data in a word. In this ... Read More

How to convert HTML to PDF using Python

Akshitha Mote

Akshitha Mote

Updated on 23-Jun-2025 17:08:48

2K+ Views

In general, we look at some external websites to convert our files to PDF format; instead, we can convert them using Python on our own. In this article, we will understand the steps to convert the HTML (Hyper Text Markup Language) to PDF using Python code. Steps to convert HTML ... Read More

Would you recommend to define multiple Python classes in a single file?

Akshitha Mote

Akshitha Mote

Updated on 11-Jun-2025 09:13:33

4K+ Views

Yes, it is recommended to define multiple Python classes in a single file. If we define one class per file, we may end up creating a large number of small files, which can be difficult to keep track of. Placing all the interrelated classes in a single file increases the ... Read More

Python3 - Why loop doesn\'t work?

Akshitha Mote

Akshitha Mote

Updated on 29-May-2025 15:56:17

212 Views

In Python, using loops, we can execute a statement or a group of statements multiple times. Usually, the loop works for all the conditions, but there are certain scenarios where the functionality of loops is affected. In this article, we will understand those scenarios with examples. When sleep() method is ... Read More

Advertisements