Alekhya Nagulavancha has Published 16 Articles

How can I iterate over files in a given directory in Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 27-May-2025 18:39:23

11K+ Views

Iterating over files in a given directory helps to perform tasks such as finding files that match certain criteria or, counting the number of files in a directory. Python provides the following five ways to walk through all the existing files in a directory - ... Read More

How to scan through a directory recursively in Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 15-May-2025 18:30:14

14K+ Views

A directory is simply defined as a collection of subdirectories and single files or either one of them. A directory hierarchy is constructed by organizing all the files and subdirectories within a main directory and this is also known as root directory. These subdirectories are separated using a / operator ... Read More

How to calculate a directory size using Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 29-Apr-2025 19:10:00

8K+ Views

A directory is simply defined as a collection of subdirectories and single files or either one of them. These subdirectories are separated using a "/" operator in a directory hierarchy. A directory hierarchy is constructed by organizing all the files and subdirectories within a main directory and also known as ... Read More

Multi-Line Statements in Python

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 19-Apr-2023 14:28:41

7K+ Views

In Python, statements are nothing but instructions given to a Python interpreter to understand and carry out. These statements are usually written in a single line of code. But, that does not mean Python does not have a provision to write these statements in multiple lines. There are two types ... Read More

How can we read inputs as integers in Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 24-Feb-2023 12:25:34

23K+ Views

In Python, there are two ways to provide input information to a program. One in which we directly assign input objects to object references/variables; and the other in which the program takes user input dynamically (during runtime). Python 2.x versions use raw_input() function to take user input dynamically; whereas, Python ... Read More

How to find if a directory exists in Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 24-Feb-2023 12:13:45

7K+ Views

Directory creation is a common task for computer users. You might need to create a directory to store some files, or to place some new files inside an existing directory. In this article, you will learn how to find if a directory already exists in Python or not. A directory ... Read More

How to print full path of current file's directory in Python?

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 24-Feb-2023 12:09:56

19K+ Views

The path of a current file is defined with the help of directory hierarchy; and it contains the backtracked path from the current file to the root directory this file is present in. For instance, consider a file “my_file” belongs to a directory “my_directory”, the path for this file is ... Read More

Python Program to Calculate Standard Deviation

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 26-Oct-2022 10:07:50

14K+ Views

In this article, we will learn how to implement a python program to calculate standard deviation on a dataset. Consider a set of values plotted on any coordinate axes. Standard deviation of these set of values, called population, is defined as the variation seen among them. If the standard deviation ... Read More

Python Program to calculate the cube root of the given number

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 26-Oct-2022 09:50:03

17K+ Views

Mathematically, a cube root of a certain number is defined as a value obtained when the number is divided by itself thrice in a row. It is the reverse of a cube value. For example, the cube root of 216 is 6, as 6 × 6 × 6 = 216. ... Read More

Python Program to calculate the volume and area of Sphere

Alekhya Nagulavancha

Alekhya Nagulavancha

Updated on 26-Oct-2022 09:25:35

6K+ Views

A sphere (solid) is usually considered a two-dimensional figure even though the figure is seen in three planes from its center. The main reason for this is that, a sphere is only measured using its radius. However, a hollow sphere is considered a three-dimensional figure since it contains space within ... Read More

Advertisements