Python Programs for practice
We have prepared a list of top 50 Python programming example questions to help Freshers and Experienced Python Developers in their preparations for the interviews. You can also use these Python programs for practice to upskill yourself.
You will find these questions very helpful in your interviews. Prepare well and All the very best.
All the feedbacks and suggestions are most welocome.
-
Count the number of each vowel in a string.
-
Sort alphabetically the words form a string provided by the user.
-
Transpose a matrix using nested loop.
-
Multiply two matrices using nested loops.
-
Write a program for handling file operation errors.
-
Write a program to display student’s information using multiple inheritances.
-
Write a program to display customer information using multilevel inheritance.
-
Small Tasks below:
-
Write a Python program to calculate number of days between two dates.
Sample dates: (2014, 7, 2), (2014, 7, 11)
-
Write a Python program to display the examination schedule.
-
Write a Python program to print the calendar of a given month and year.
-
Write a Python program to get file creation and modification date/times
-
Python program to convert time from 12 hour to 24 hour format
-
-
Write a Python program to create a histogram from a given list of integers.
-
Write a Python program that will accept the base and height of a triangle and compute the area.
-
Write a Python program to compute the greatest common divisor (GCD) of two positive integers.
-
Write a Python program to get the least common multiple (LCM) of two positive integers.
-
Set of small tasks related to OS administration:
-
Write a Python program to get OS name, platform and release information.
-
Write a Python program to find out the number of CPUs using
-
Write a Python program to check whether a file exists
-
Write a Python program to list all files in a directory in Python
-
Write a python program to access environment variables.
-
-
Write a python program to sum of the first n positive integers.
-
Write a Python program to convert height (in feet and inches) to centimeters.
-
Write a Python program to convert the distance (in feet) to inches, yards, and miles.
-
Write a Python program to convert all units of time into seconds.
-
Python program to print all Prime numbers in an Interval.
-
Python Program for How to check if a given number is Fibonacci number?
-
Python program to find second largest number in a list
-
Write a program to remove duplicate elements from list.
-
Python program to print even length words in a string
-
Python | Count the Number of matching characters in a pair of string
-
Remove all duplicates from a given string in Python
-
Python | Program to check if a string contains any special character
-
Python program to find the sum of all items in a dictionary
-
Set of taks regarding pattern print:
-
Print an Inverted Star Pattern
-
Print Diamond Pattern
-
Program to print the pattern ‘G’
-
Program to print the given Z Pattern
-
Program to print the pattern "GFG"
-
Print the given pattern recursively
-
Program to print the pattern "D"
-
Program to print the pattern "H"
-
-
Find the position from where the parenthesis is not balanced
-
Write a program to get all substrings of given string
-
Write a program to converts json data into python Dictionary
-
Write a Python program to convert Python object to JSON data.
-
Write a Python program to print a long text, convert the string to a list and print all the words and their frequencies.
-
Write a Python program to count the number of each character of a given text of a text file.
-
Write a Python program to get all strobogrammatic numbers that are of length n.
A strobogrammatic number is a number whose numeral is rotationally symmetric, so that it appears the same when rotated 180 degrees. In other words, the numeral looks the same rightside up and upside down (e.g., 69, 96, 1001).
For example:
- Given n = 2, return ["11", "69", "88", "96"]. - Given n = 3, return ['818', '111', '916', '619', '808', '101', '906', '609', '888', '181', '986', '689']
-
Write a Python program to find the number of notes (Sample of notes: 10, 20, 50, 100, 200 and 500 ) against an given amount.
-
Write a Python program to find the number of divisors of a given integer is even or odd.
-
Write a Python program to combine each line from first file with the corresponding line in second file.
-
Write a Python program to make two given strings (lower case, may or may not be of the same length) anagrams removing any characters from any of the strings.
-
Write a Python program to count Uppercase, Lowercase, special character and numeric values in a given string.
-
Perform following operations with Hospital Database
-
Connect to the database and print its version
-
Read given Hospital and Doctor Information
-
Get List Of Doctors as per Speciality
-
Get List of doctors within a given Hospital
-
update doctor experience in years
-
-
Create a basic calculator using python GUI(Tkinter)
-
Create a GUI application which for student info.(use mysql database backend)
-
Create a GUI for login page and connect with database..
-
Write a program for e-mail sending in python.
-
Write a simple client-serveri(chatting) python program using socket.
-
Write a program to print Armstrong number from 1 to 10000.
-
Write a program to print Perfect number from 1 to 10000.
-
Write a program to print Special number from 1 to 10000.
-
Write a program to reverse alternative word in a given string.
-
Write a program for following:
input: a3b5c7 output: adbgcj
-
Write a program for following:
input: a3b2c4 output: aaabbcccc
You may also refer to other interview preparation articles:
- Linux Interview Questions for Freshers
- Linux Interview Questions for Freshers - 2
- Linux Interview Questions for Freshers and Experienced - L1
- Linux Interview Questions for Experienced Linux Admins - L2
- Advanced Linux Interview Questions for Experienced Admins - L3
- Shell-Scripting interview questions
- OS Network Interview Questions
- GCP ACE Practice Questions - 1st
- GCP ACE Practice Questions - 2nd
- AWS Certified SysOps Administrator - Questions and Answers-1st
- AWS Certified SysOps Administrator - Questions and Answers-2nd
- AWS interview questions for experienced professionals - 1st
- AWS interview questions for experienced professionals - 2nd
- Ansible interview questions
- Kubernetes interview questions
- DevOps Interview Questions for Freshers and Experienced
- DevOps Interview Questions for Freshers and Experienced - 2
- GIT Interview Questions for DevOps Roles
- Jenkins Interview Questions for Experienced DevOps Engineer
- Terraform Interview Questions for Experienced DevOps Engineer
- Terraform Interview Questions for Experienced DevOps Engineer - 2
- Terraform Interview Questions for Experienced DevOps Engineer - 3
- JAVA Interview Questions
- JAVA Interview Questions - 2
- Manual Testing Interview Questions for QA Engineers/Testers
- DBMS Interview Questions
- Managerial interview questions
- Microsoft Azure Administrator AZ-103
You may also explore other articles in our bucket, Happy reading !!:
- What is Artificial Intelligence ?
- What is Machine Learning ?
- Unleashing the Power of Artificial Intelligence
- What is Neural Networks ?
- What is Internet of Things (IoT) ?
- What is Natural Language Processing (NLP) ?
- What is Robotics and Automation ?
- Quantum Computing: The Next Frontier
- Blockchain: A Primer for Beginners
- What is Virtual Reality (VR) ?
- Cybersecurity: Protecting our digital world
- What is AI Chat Open Assistant Chatbot ?
- What is Bard chatbot ?