Python Tuple Tuples are used to store multiple items in a single variable. Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities...
Tag - Python Examples
Write a program to check whether a person is eligible to vote or not in Python
In this tutorial we are writing a Python Program to Check Eligibility for voting. To check that a person is eligible for voting or not, we need to check whether person’s age is greater than or equal to 18...
22 Different Star Pattern Programs in Python
Python Star Pattern Example : 1 ** ** * ** * * ** * * * * Python for i in range(0, 5): for j in range(0, i+1): print("* ",end="") print() 123456 for i in range(0, 5): for j in range(0...
Python Data Types with Examples
In this post, we will learn about the data type used in Python. Every programming language has this same concept as the data type. Similarly, Python has a data type of every variable that is used in the code. The datatype is very...
Find Sum Of Elements In A List in Python
In this article, we will learn How to find sum of elements in a list in Python. In this article, we will show you how to find the sum of numbers of the list in Python language;. This programs take input from the user for the list...
Find the Greatest of Three Numbers Using the Function in Python
In this example, we will discuss the concept of the Python program:find the greatest of three numbers using the function In this post, we will learn how to find the greatest number of three numbers using a user-defined function...
Add Two Number Using Function in Python
In this tutorial, we will learn a simple concept of how to add two numbers using the function in the Python programming language. Add two integer number using the function Python #Python program to add two numbers using function...
Sort a Dictionary in Python
In this example, we will learn how to sort a dictionary in python. In the below example we will sort a dictionary by key, value, and items. Sort by key: Python dict = {} dict['1'] = 'Ford' dict['4'] = 'Audi' dict['2'] = 'Toyota'...
Simple Python Programs with Examples
The best way to learn Python is by practicing examples. The page contains examples on basic concepts of Python. You are advised to take the references from these examples and try them on your own. All the programs on this page...
Filter the Positive Numbers from a list in Python
In this example, i’ll show you how to filter the positive numbers from a list. Python Code: Python nums = [-15, 12, 15, -5] print("Original numbers in the list: ",nums) Pos_nums = list(filter(lambda x: x >0, nums))...