Practical List

Python Practical List


 Day - 1


1. Print "Python Programming" 
2. Print Your Name On screen. 
3. Print Address on screen.(Min 3 Lines) 


Day - 2


4. Enter the value of an integer variable and print it on screen. 
5. Input two numbers and prints its square and cube. 
6. Input two numbers and prints its Addition, Subtraction, Multiplication, and Division. 
7. Calculate the area of circle. 
8. Calculate the area of Triangle.
9.  Write a program to count the simple interest.
10. Input a Rupees and prints its value converted into Dollar. 


Day - 3


11. Enter value and check it is less, equal or greater than zero. 
12. Input 2 number and print the maximum among them. 
13. Input 2 number and print the minimum among them. 
14. Input 3 number and print the maximum among them.
15. Write a program that interchange or swap the values of 2 variables. 
16. Write a program to interchange the value of 2 variables without using 3rd variable.
17. Write a program to check whether the entered no is odd or even.
18. Get a character in lower case form user and display it in the upper case. 
19. Get a character from user and print tell that is it vowel or consonant.  
20. Write a program that takes input of 5 subject marks. Count the percentage. 
Print the result  for the following condition 
If  student has 70% or more then 70% then DISTINCTION. 
If  student has a percentage between 60 and 69 then FIRST CLASS. 
If  student has a percentage between 50 and 59 then SECOND CLASS. 
If  student has a percentage between 40 and 49 then PASS CLASS. 
If  student has a percentage less then 40  then FAIL.


Day - 4


21. Print 1 to 10. 
22. Print 2,4,6,8,10,
23. Print 1,3,5,7,9, 
24. Print 1,2,4,8,16,32,64,
25. Print 10 to 1 
26. Print 1,10,2,9,3,8,4,7,5,6
27. Print 1,11,20,28,35,41,46,50,53,55,56,
28. Print first 100 even numbers.
29. Print first 100 odd numbers. 
30. Print the total of 1 to 50


Day - 5


31. Accept one no from user and display Reverse of it. 
32. Accept one no from user and display the sum of its digits. 
33. Accept one no from user and display its factorial. 
34. Accept one no from user and find if it is prime or not. 
35. Accept one no from user and find if it is Armstrong or not.
36. Print 0 1 1 2 3 5 8 13 21 34 55 … (Fibonacci series) .
37. Accept one no from user and find if it is Perfect or not.


Day - 6


38. Print pattern like follow. 
12345

39. Print pattern like follow. 
1
2
3
4
5

40. Print pattern like follow. 
12345
12345 
12345
12345
12345

41. Print pattern like follow. 
11111
22222
33333
44444
55555

42. Print pattern like follow. 
1   2   3    4   5
2   4   6    8   10
3   6   9   12  15
4   8  12  16  20
5  10 15  20  25

43. Print pattern like follow. 
A A A A A
B B B B B 
C C C C C
D D D D D
E E E E E


Day - 7

44. Print pattern like follow.  

22 
333 
44444 
555555 

45. Print pattern like follow.  

12 
123 
1234 
12345 

46. Print pattern like follow.  

54 
543 
5432 
54321 

47. Print pattern like follow.  

21 
321 
4321 
54321 

48. Print pattern like follow.  
 1 
 2  3 
 4  5  6 
 7  8  9 10 
11 12 13 14 15 


49. Print pattern like follow.  

10 
100 
1000 
10000 

50. Print pattern like follow.  

01 
010 
1010 
10101 

51. Print pattern like follow.  

10 
101 
1010 
10101 

52. Print pattern like follow.  

bb 
ccc 
dddd 
eeeee 

53. Print pattern like follow.  

b c 
d e f 
g h i j 
k l m n o 

54. Print pattern like follow.  

y x 
w v u 
t s r q 
p o n m l 

55. Print pattern like follow.  

45 
345 
2345 
12345


Day - 8

56. Print pattern like follow.  
12345 
1234 
123 
12 


57. Print pattern like follow.  
12345 
2468 
369 
48 


58. Print pattern like follow.  
54321 
5432 
543 
54 


59. Print pattern like follow.  
54321 
4321 
321 
21 


60. Print pattern like follow.  
12345 
2345 
345 
45 


61. Print pattern like follow.  
55555 
4444 
333 
22 


62. Print pattern like follow.  
2 4 6 8 10 
4 6 8 10 
6 8 10 
8 10 
10 

63. Print pattern like follow.  
a b c d e 
b c d e 
c d e 
d e 



Day - 9

64. Write a program that performs the following output for n rows 
1 2 3 4 5 4 3 2 1 
1 2 3 4    4 3 2 1 
1 2 3          3 2 1 
1 2                2 1 
1                      1

65. Print the Diamond Shape on the screen with "*" character.

66. Print a Square shape on the screen with "*" character.

67. Print a Triangle shape on the screen with "*" character.


Day - 10

68. Get String from User then Count and Print No of Space in String.

69. Get String from User then Count and Print No of vowels in String.

70. Get a String from the User and Count the no of Words in the String.

71. Get Two Strings from the User and Check whether they are the same or Not.

72. Get a String from the User and Check whether it is Palindrome or Not.

73. Get a String from the User and Find the frequency of each character in a String.

74. Get a String from the User and Find the frequency of the Substring in a String.


Day - 11

75. Write a function(s) to perform calculator Operations.

76. Write a function to find the max from the given two values.

77. Write a function to check whether the given number is prime or not.

78. Write a function to print the factorial of the given number using recursion.

79. Write a function to calculate the power of the given number. The default power is 1.

80. Write a function to find an average of the given n numbers of arguments.


Day - 12

81. Write a Lambda expression to find the max out of two variables.

82. Write a Code to demonstrate the following operations on List.
a) Print all values in the List
b) Append Value in the List
c) Insert Value at a specific position
d) Count no of values/objects in the List
e) Specific value/object is present in the list or not
f) Find the position of a specific value in the List
g) Print the first three values of the List
h) Print the last three values of the List
i) Print 2 to 5 position values in the List
j) Print the 3rd position value in the List
k) Print the 3rd position onwards all values in the list
l) Print all values upto 3rd position
m) Find and replace the particular value in List (Single)
n) Find and replace the particular value in List (Multiple)
o) Count the no of occurrences of a value in the List
p) Print the List in reverse order
q) Extend the List with another List
r) Delete specific values from the List
s) Delete a value from a specific position
t) Delete the last element from List
u) Sort elements in the List 
v) Delete List


Day - 13

83. Write a Code to demonstrate the following operations on Tuple.
 a) Print all values in Tuple
 b) Append Value in Tuple
 c) Insert Value at a specific position
 d) Count no of values/objects in Tuple
 e) Specific value/object is present in Tuple or not
 f) Find the position of a specific value in Tuple
 g) Print the first three values of the Tuple
 h) Print the last three values of the Tuple
 i) Print 2 to 5 position values in Tuple
 j) Print 3rd position value in Tuple
 k) Print 3rd position onwards all values in Tuple
 l) Print all values upto 3rd position
 m) Find and replace particular value in Tuple (Single)
 n) Find and replace the particular value in Tuple (Multiple)
 o) Count the no of occurrences of a value in a Tuple
 p) Print Tuple in reverse order
 q) Extend Tuple with another Tuple
 r) Delete a specific value from Tuple
 s) Delete value from a specific position
 t) Delete the last element from Tuple
 u) Sort elements in Tuple 
 v) Delete Tuple


Day - 14

84. Write a Code to demonstrate the following operations on Set.
 a) Print all values in Set
 b) Add Value in Set
 c) Count no of values/objects in Set
 d) Specific value/object is present in the Set or not
 e) Extend the Set with another Set
 f) Find the Difference between two Sets
 g) Print Union of two Sets
 h) Print the Intersection of Two Sets
 i) Check Weather Set is a subset of the given Set
 j) Check Weather Set is a superset of the given Set
 k) Print the Symmetric difference between two Sets
 l) Check Weather Two Sets are Disjoint or not
 m) Delete a specific value from Set 
 n) Delete Set


Day - 15

85. Write a Code to demonstrate the following operations on Dictionary.
 a) Print all values in Dictionary
 b) Add Value in the Dictionary
 c) Print Value using Key
 c) Count no of values/objects in the Dictionary
 d) Specific key/value is present in Dictionary or not
 e) Extend the Dictionary with another Dictionary
 f) Update the value of specific Keys in the Dictionary
 g) Delete specific values from Dictionary 
 h) Delete Dictionary

Day - 16

86. Write a Python Program to demonstrate how you can handle IndexError with Exception Handling {IndexError: list index out of range}

87. Create Class Student with s_rollno, s_name, and marks. Write an appropriate Constructor to create an Object. Create a few objects of the class and display all student detail using the s_display method.

Day - 17

88. Create Class A->B, B->C. Demonstrate Multilevel Inheritance using all class. Create display method in all class and call them using Class C Object.

89. Create Class A->C, B->C. Demonstrate Multiple Inheritance using all class.

Day - 18

90. Create Book class with b_id, b_title and b_price. Write appropriate constructors and methods to handle the program. Create Custom exception "BookPriceCanNotBeNegative" and raise an exception if b_price value is negative.


91. Write a Python program to Demonstrate Operator Overloading for +.

Comments