Python Programming | Practical Programs | Program Codes

---------------×------------------××--------------------×---------------

Python Programming 

---------------×------------------××--------------------×---------------

Practical Programs


1. Write a program to find the square root of a number.  


2. Write a program to convert bits to Megabytes, Gigabytes and Terabytes.




3. Write a program to swap the value of two variables.



4. Write a program to calculate surface volume and area of a cylinder.



5. Write a program to check if the input year is a leap year of not.



6. Write a program to check if a Number is Positive, Negative or Zero



7. Write a program that takes the marks of 5 subjects and displays the grades



8. Write a python program to find Fibonacci series for given number. 



9. Write a python program to find sum of four digit number.



10. Write a Python program to find common items from two lists.



11. Create a tuple and find the minimum and maximum number from it.



12. Write a Python program to find the repeated items of a tuple.

 

13. Write a Python script to concatenate following dictionaries to create a new one. 
Sample Dictionary: dic1 = {1:10, 2:20} dic2 = {3:30, 4:40} dic3 = {5:50,6:60}



14. Write a Python program to combine two dictionary adding values for common keys. 
 d1 = {'a': 100, 'b': 200, 'c':300} d2 = {'a': 300, 'b': 200, 'd':400}



15. Write a Python program to create two matrices and perform addition, subtraction, multiplication and division operation on matrix using NumPy.



16. Write a python program to concatenate two strings using NumPy.



17. Write a Python class to reverse a string word by word.



18. Write a Python class named Rectangle constructed from length and width and a method that will compute the area of a rectangle.



19. Write a Python program to create a class to print the area of a square and a rectangle. The class has two methods with the same name but different number of parameters. The method for printing area of rectangle has two parameters which are length and breadth respectively while the other method for printing area of square has one parameter which is side of square.




20. Write a Python program to create a class 'Degree' having a method 'getDegree' that prints "I got a degree". It has two subclasses namely 'Undergraduate' and Postgraduate' each having a method with the same name that prints "I am an Undergraduate" and "I am a Postgraduate" respectively. Call the method by creating an object of each of the three classes.



21. Write a Python program to create series from array using Panda.








Post a Comment

0 Comments