Python(SOC) Lab External Examination
Python(SOC) Lab External Examination(23CSS1)
Date:16-11-2024
1a)To print the given patterns.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
where n=5
b)To find the GCD of 2 numbers using recursion.
2a)To compute the series 1/12 + 1/22 + 1/32+--- +1/n2.
b)To generate the niH Fibonacci number using recursion.
3a)To check whether the given number is Armstrong or not.
b)Write a program to take a dictionary from the keyboard and print the sum of values
c)Write a Python program to print each line of a file in reverse order.4a)Write a program to check whether the given number is palindrome or not.
b)Write a program to find the number of occurrences of each letter present in the given string
c)Write a program to print multiplication and transpose of the given matrices.5a)Write a program to check whether the given number is prime or not.
b)Write a program to find the number of occurrences of each vowel present in the given string
c)Write a Python program to find empty strings from a list of strings.6a)Write a program to calculate and print the electricity bill of a given customer.
b)How do you access and delete instance variables?
c) Write a program to sort words in a file and put them into another file.7a)To calculate the bonus that must be given to the employee and display the salary the employee will get.
b)Program to demonstrate constructor will execute only once per object
c) write a program to count the number of consonants and vowels in a string.8a)Write a program to calculate the roots of a quadratic equation.
b)Write a Python program to create a Student class and Create an object to it. Call the method talk() to display student details
c) Write a program to create tuples with at least 2 numbers, concatenate the tuples and Print the concatenated tuples.9a)Write a program to enter the marks of a student for four subjects and calculate the percentage.
b)Write a program to accept student names and marks from the keyboard and create a dictionary. Also, display student marks by taking student name as input
c)How to check whether a particular file exists or not?10a)Implementing a program to read two complex numbers and perform addition and
subtraction.
b)Write a program to handle Zero Division Errors and multiple exceptions.
c)Program to print the number of lines, words and characters in the given file?
Comments
Post a Comment