python

python

Python program to find the sum of all values of a dictionary

In this tutorial, we will learn how to find the sum of all the values of a dictionary in python.

Read
python

Python program to sort values of one list using second list

In this example program, we will learn how to sort elements of one list by using elements of a different list.

Read
python

Python program to check if a year is a leap year or not

To check if a year is a leap year or not, we need to check if it is divisible by 4 or not. A year is a leap year if it is divisible by 4 and for century years if it also divisible by 400.

Read
python

Python program to find the largest even and odd numbers in a list

In this tutorial, we will write one python 3 program to find out the largest odd and even number in a list. The user will enter all the numbers to store in the list. Next, we will run one loop to find out the largest even and odd numbers. We will use one loop to read the numbers to the list. You can use one already populated list but we will take the numbers from the user here.

Read
python

Python index method to get the index of an item in a list

The 'index' method is used to find the index of the first occurrence of an item in a list. The syntax of 'index' method is as below :.

Read
python

Python 3 program to find union of two lists using set

In this tutorial, we will learn how to find the union of two lists using set in Python 3. To find the union of two lists, we don't have any built-in methods. We are going to use 'set' to find the union.

Read
python

Python program to print a triangle using star

In this tutorial, we will learn how to print a triangle using star (* ). You can change it to any other characters if you want. Printing a symbol works the same for any programming language. You can use the same logic on any other programming language like Java, R, C, C++ etc. to get the same output.

Read
python

Zip function in python and how to use it

The syntax of zip() function is 'zip(*iterables)' that means it will take multiple iterables as inputs. It makes an iterator aggregating elements from each of the iterable.

Read
python

5 ways in Python to print inverted right-angled triangle

Python examples to print an inverted right-angled triangle in 4 different ways. Learn to print number triangles or character triangles with examples in this post.

Read
python

4 Python examples to print all even numbers in a given range

4 Different ways to print the even numbers in a given range. We will use a for loop, while loop, jump in between the numbers with a while loop and how to use the range function.

Read