Lab - PGM 1
Lab - PGM 1
same.
b) Write a Python program to circulate the values of n variables
3) a) Write a Python Program to get the 5 bank customer account details with balance and printonly the
customer details whose balance is greater than or equal to 10000
b) Write a python program to define a module to find Fibonacci Numbers and import the moduleto another
program.
4) a) Write a Python program that prints out the decimal equivalents of 1/2, 1/3, 1/4, . . . ,Using for loop
b)Write a Python Program to print the Following number Pattern
55555
4444
333
22
1
b) Write a Python script to print a dictionary where the keys are numbers between 1 and 15
and the values are square of keys
Sample Dictionary {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100, 11: 121,
12: 144, 13: 169, 14: 196, 15: 225}
b) Write a Python program to create a dictionary from a string and count the letters from the
string. Sample string : 'ENGINEERING'
Expected output: {'E': 3, 'N': 3, 'G': 2, 'I': 2, 'R': 1}
8. a) Write a Python program that accepts a comma separated sequence of words as input andprints the
unique words in sorted form.
b) Write a Python program to print the sum of first 100 odd numbers.
9. a) Write a python program to that accepts length of three sides of a triangle as inputs. The program should
indicate whether or not the triangle is a right angled triangle (use
Pythagorean theorem):
b) Write a Python Program to Print all Prime numbers less than 50.
10. a) Define a function fact and write a python Script to find the factorial of a number
i) Create a Tuple
ii) Find the length of the Tuple
iii) find the maximum and minimum element in the tuple
1.ADDITITON OPERATION
2.SUBSTRACTION OPERATION
3.MULTIPICATION OPERATION
4.DIVISION OPERATION
Accepts users input and perform the operation accordingly.
b) Write a Python Program to Compute Electrical current in a three Phase Electrical Circuit
12. a) Write a Python Program to find the Third Largest number in a given list using Functions.
b) Write a Python Program to count the number of Words present in a text file.
14. a) Create three text file such as “source1.txt”,”source2.txt”, in read mode , “target.txt” in write
mode and write a Python Script to copy the content of “source1.txt”,”source2.txt”, and write
the content in “target.txt file”.
b) Write a Python code to get the voters age as input. If the user Enters a Valid age as input
Display the Result otherwise Raise the Exception.
b) Write a Python program to display the current date and time. In the Following format. .:
2022-06-06 15:35:15. 16. a) Write a Python program to append text to a file and display the text in the output
screen.
16. a) Write a Python program to append text to a file and display the text in the output screen.
b) Write a Python program which accepts the user's first and last name and print them in
reverse order with a space between them.
17. a) Write the Python program To compute sin(x) using the below given Formula