Saba Hilal has Published 65 Articles

Python Program to Find Sum of First and Last Digit

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 16:51:14

865 Views

In this article, the given task is to add the first and the last digit of an integer. Now the integer can be very small or it can be a big number. So, these programs will have two parts. First, we need to find how big the integer is and ... Read More

Python program to print positive numbers in a list

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 16:23:30

358 Views

In this article, the task is to print the positive numbers from a list of integers. Here, in this Python article, this task is done using the different methods in 4 different examples. Then these positive numbers are printed. In example 1, the positive numbers are picked and separated into ... Read More

Python Program to Find Unique Lines From Two Text Files

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:52:36

219 Views

Many times we see two files that look similar but had certain differences. If the files are big or have lots of content, searching for that difference or finding the uniqueness in that file manually is not easy. However, this problem of finding the unique lines in two text files ... Read More

Python program to find start and end indices of all Words in a String

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:50:05

184 Views

Sometimes, we require starting index of a word and also the last index of that word. A sentence is made up of words that are separated by spaces. In this Python article, using two different examples, the two different ways of finding the beginning and ending indices of all words ... Read More

Python Program to Get Sum of N Armstrong Numbers

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:46:46

99 Views

A number is said to be an Armstrong number if the digits are taken individually and raised to the power of the total digits and then these subparts are added together and they give the number itself. Here, in this Python example, using two different examples, the method of finding ... Read More

Python Program to find Sum of Negative, +ve Even and +ve Odd numbers in a List

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:41:43

505 Views

Sometimes the task is to separate the negative and positive numbers or to separate the odd numbers and even numbers from a list of integers. Here, in this Python article, both these tasks are done. First negative numbers are separated into another list. Then the positive odd and positive even ... Read More

Python Program to Find Numbers Divisible by 7 and Multiple of 5 in a Given Range

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:38:57

916 Views

A multiple of a number n is also divisible by the same number n. If a number M is a multiple of a number n, then if we divide M by n, its remainder must be zero. Also to create the multiples of number n within a given range, we ... Read More

Python program to find the string weight

Saba Hilal

Saba Hilal

Updated on 10-Jul-2023 15:29:07

373 Views

In this article, the given task is to find the total string weight. To calculate the string weight, we have converted the given strings into the lower form. Considering the weight of the characters, we have taken a=1, b=, 2 and so up to z=26. In this Python article, using ... Read More

How to load and save 3D Numpy Array file using savetxt() and loadtxt() functions?

Saba Hilal

Saba Hilal

Updated on 11-May-2023 11:40:23

3K+ Views

For using arrays in Python, NumPy is commonly used. Sometimes, the data is stored in a multidimensional or 3D array. If loadtxt() or savetxt() functions are used to save or load the array data, it will require a 2d array. If the 3D array is used, then it will give ... Read More

How to lowercase the column names in Pandas dataframe?

Saba Hilal

Saba Hilal

Updated on 11-May-2023 11:31:39

4K+ Views

In this article, the user will understand how to lowercase the column names in Pandas dataframe. Using three different examples, the ways are given for converting the dataframe columns in lowercase. For these examples, a Zomato dataset given on Kaggle is used. The kaggle dataset was available in CSV (Comma ... Read More

Advertisements