Python Programming Examples : This page contains Python programming examples that cover the concepts, including basic and simple python programs,Function Programs,Text file programs, Binary File Programs,CSV file Programs,pandas programs, SQL programs, List Programs, series programs, etc.
All these Python programs are explained with multiple examples, and we also did the code analysis. Please visit the python quizz to check your score.
- To find the sale price of an item with given cost and discount
- To calculate perimeter/ circumference and area of shapes such as triangle, rectangle, square and circle
- To calculate simple and compound interest
- To calculate profit loss for a given cost and sale price
- To calculate EMI for amount, period and interest
- To calculate tax-GST/ income tax
- To find the largest and smallest numbers in a list
- To find third largest/ smallest number in a list
- To find sum of squares of the first hundred natural numbers
- To print the first n multiples of given number
- To count the number of vowels in a user entered string
- To print the words starting with particular alphabet in a user entered string
- To print the number of occurrences of a given alphabet in a given string
- Create a dictionary to store names of state and their capitals
- Create a dictionary of students to store names and marks obtained in five subjects
- To print the highest and lowest value in the dictionary
- Program to print multiplication table of any number
- Program to check whether it is palindrome or not
- Program to create random number generator which generate random number between 1 and 6
- Python program to calculate number of minutes in a week,month and year
- Python program to calculate number of seconds in a year
- Write a python program to print one of the words negative ,zero or positive.
- Python program to convert number of seconds into minutes and remaining seconds
- Program to write user defined function to swap two number and display number before swapping and after swapping
- Python Program to calculate arithmetic operation on two number using user defined function
- Python Program to Calculate diameter and area of circle using user defined function
Text File Programs
- Python Program to read text file and find out longest word from file
- Python Program to count number of words in a file
- Python program to write those lines which have the character ‘P’ from one text file to another text file
- Python program to get file size in bytes
- Python program to create list of email ids and write list into text file
- Python program to select word randomly from text file and store it in another file.
Binary File Programs
- Python program to read file line by line and store all the contents of file into array
- Python program to write student data in binary file
- Python program to delete student data from binary file
- Python program to modify or update student data from binary file
- Python program to get mode and encoding format of file
- Python program to search specific data in binary file
CSV File Programs
- Python program to read all the contents of CSV file and display only specific columns
- Python program to write python list to CSV file and display the contents.
- Write a program to import and export data between Pandas and CSV file.
- Write a program to create pie chart of five most countries are affected by corona virus in 2020. Read the data from CSV file.
- Write a program to create Pandas series from dictionary of values and nd array.
- Write a program to perform mathematical operation on two Pandas series object.
- Write a program to create data frame quarterly sales where each row contain the item category, item name and expenditure. Group the row by the category and print the total expenditure per category.
- Write a program to create data frame based on e-commerce data and generate descriptive statistics.
- Write a program to create data frame for examination result and display row labels, column labels data types of each column and the dimensions.
- Write a Pandas program to select the rows where the number of attempts in the examination is greater than 2.
- Write a Pandas program to count the number of rows and columns of a Data Frame.
- Write a Pandas program to select the rows the score is between 15 and 20 (inclusive).
- Write a Pandas program to select the rows where the score is missing, i.e. is NaN.
- Write a Pandas program to find and replace the missing values in a given Data Frame which do not have any valuable information
- Write a Pandas program to calculate the mean score for each different student in Data Frame.
- Write a program to analyze the performance of student on different parameters subject wise or class wise from the given school result data.
- Write a program to analyze and plot appropriate chart with title and legend for the data frame created above.