An open API service indexing awesome lists of open source software.

https://github.com/birjuvachhani/python-practicals

Basic Python practicals to begin with python
https://github.com/birjuvachhani/python-practicals

Last synced: 6 months ago
JSON representation

Basic Python practicals to begin with python

Awesome Lists containing this project

README

          

# python-practicals
Basic Python practicals to begin with python.

![banner](python.png)

## Set 1
- [x] 1. WAP to display basic details of a User like Name, Roll no, Division and Address.

- [x] 2. WAP to perform arithmetic operations in python.

- [x] 3. WAP to Convert no. of Days into No. of Months and days.

- [x] 4. WAP to convert temperature from Celsius to Fahrenheit.

- [x] 5. WAP to convert distance from C.M. into meter, KM., feet, and inches.

## Set 2
- [x] 1. WAP to check whether the number is positive or not.

- [x] 2. WAP to find the largest among three numbers.

- [x] 3. WAP to find average of N numbers using while loop.

- [x] 4. WAP to find given number is PRIME or NOT using for loop.
- [x] 5. WAP to print Multiplication Table.

- [x] 6. WAP to find factorial of a given number.

- [x] 7. WAP that demonstrates the use of break and continue statements to alter the flow of the loop.

- [x] 8. WAP to prompt the user for hours and rate per hour to compute gross pay. Company will give the employee 1.5 times the Hourly rate for hours worked above 40 hours.

- [x] 9. Given the family relationship below output all persons who fit in the input characteristic. These characteristics are SIBLING, PARENT, CHILD, GRANDPARENT and GRANDCHILD.


Family 1 -> Ann and Marty have children Bill, Cathy and Frank. Cathy and Don have children Madd and Sally. Frank and Jill have child Sarah. Bill and Alice have no children.


Family 2 -> Debbie and Phil have children Jill and Betty. Jill and Frank have child Sarah. Betty and Paul have children Marry, Jane and Bart.

## Set 3
- [x] 1. WAP which will print a string as it is except # and done is entered.

- [x] 2. WAP to extract paruluniversity.ac.in from python.team@paruluniversity.ac.in using string functions.

- [x] 3. Write a program to concatenate the two lists.

- [x] 4. WAP to find the largest and smallest value in a list or sequence.

- [x] 5. WAP to demonstrate tuple operation.

- [x] 6. WAP to count the occurrences of each word in the following sentence using dict().


the clown ran after the car
and the car ran into the tent
and the tent fell down on the
clown and the car

- [x] 7. WAP to demonstrate set operation.

## Set 4
- [x] 1. WAP to create a Function to swap values of a pair of integers.

- [x] 2. WAP to print Fibonacci series of n numbers, where n is given by the programmer.

- [x] 3. WAP read a set of numbers from keyboard & to find the sum of all elements of the given array using a function.

- [x] 4. WAP to demonstrate usage of positional, keyword and default parameters.

- [x] 5. WAP to implement take a break story. This program will notify users to take a break by playing their favorite video on YouTube after fixed amount of time.

- [x] 6. WAP to help weatherman
who will predict weather for a particular week and for next seven days. Implement this scenario by creating two modules namely daily.py and weekly.py for predicting daily and weekly weather respectively.

## Set 5
- [x] 1. WAP to read data from keyboard & write it to the file. After writing is completed, the file is closed. The program again opens the same file and reads it.
- [x] 2. WAP to prompt for a file name, and then read through the file and look for lines of
the form: X-DSPAM-Confidence:0.8475


When you encounter a line that starts with “X-DSPAM-Confidence:”


pull apart the line to extract the floating-point number on the line. Count these lines and then compute the total of the spam confidence values from these lines. When you reach the end of the file, print out the average spam confidence.



Enter the file name: mbox.txt



Average spam confidence: 0.894128046745

- [x] 3. Assume that your friend is playing prank with you. You are not able to find your house keys. Your friend has hidden your house keys. If you want your keys back, solve the puzzle. Go to prank folder in your computer. Rename all the files by removing numbers from the filename. You will get the location where keys are hidden.

- [x] 4. Write a program in Python that reads a file and adds backslash (\\) before every double quote it encounters. And then writes it to another file in the same folder.



For example:

If the file name is TestFile1.txt with text Jack said, “Hello Pune”. The output to the file TestFile2.txt should be Jack said,\“Hello Pune\”.

- [x] 5. Assume that there is a folder (directory) by name “root”. This folder has some files and some subfolders. Each subfolder in turn may have files and subfolders. Write a program to lists all the files inside all the folders/subfolders along with their absolute path.

## Set 6
- [x] 1. Rewrite compute salary program (2.8) using try and except.
- [x] 2. WAP to demonstrate usage of one try block with multiple except block and else clause.
- [x] 3. WAP to demonstrate usage of Python debugging module.

## Set 7
- [x] 1. Rewrite Spam confidence program (5.2) using try and except.
- [x] 2. WAP to read through the mail box data and when you find line that starts with “From”, you will split the line into words using the split function. We are
interested in who sent the message, which is the
second word on the From line.


From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008


You will parse the From line using regular
expression and print out the second word for each From
line, then you will also count the number of From
(not From:) lines and print out a count at the end.


Enter a file name: mbox-short.txt

stephen.marquard@uct.ac.za louis@media.berkeley.edu zqian@umich.edu
- [x] 3. WAP to demonstrate usage of compile() method of RE module in Python.

## Set 8
- [x] 1. WAP to draw a flower using turtle to understand the concepts of OOP.

- [x] 2. Define a class name Circle which can be constructed using a parameter radius. The circle class has a method which can compute the area using area method.

- [x] 3. Create class namely Employee. And show the Employee name, salary and count using OOP concept.

- [x] 4. Create two classes namely Employee and Qualification. Using multiple inheritance derive two classes Scientist and anager. Take suitable attributes & operations. WAP to implement this class hierarchy.

- [x] 5. Use concept of classes and object to create a website for playing movie trailer. (Mini Project)

## Set 9
- [x] 1. Write a program to implement Linear Search Technique.

- [x] 2. Write a program to implement Binary Search Technique.

- [x] 3. Write a program to implement Hashing technique.

- [x] 4. Write a program to implement Bubble Sort Technique.

- [x] 5. Write a program to implement Merge Sort Technique

- [x] 6. Write a program to implement Insertion Sort Technique.

## Set 10
- [x] 1. Develop a chat room application using multithreading in Python.

- [x] 2. Implement any one sorting algorithm using TCP/UDP on Server application. Provide the input on Client side and client should receive sorted output from server. Display the sorted output on client.

- [x] 3. Draw Initial of your Name and Surname in Turtle.

- [x] 4. Write a Python program to create multi-widget GUI using Tkinter.

- [x] 5. Write a program to plot different types of graphs using PyPlot.

- [x] 6. Write a Python program to read text from a file. Find out occurrence of each word in dictionary. Create a graphical representation of the same using a bar chart. Give label to chart, x-axis and y-axis.

- [x] 7. Write a program to find out whether a number is possible by adding
6,9,20 to each other(Mcchicken Nuggets Problem).