QB_Slow_Learners
QB_Slow_Learners
2. With syntax and examples, explain print ( ), input ( ), len ( ), and string replication functions L2 1
3. What are variables? Explain the rules to be followed while defining a variable with valid and L2 1
invalid examples.
4. Demonstrate different types of operators available in Python with proper examples. L2 1
5. Explain if, elif, and else statements in Python with syntax, flowchart and program snippets. L2 2
6. Explain looping control statements with syntax, flow diagrams and program snippets. L2 2
7. Demonstrate the working of break and continue statements with programming examples for L2 2
each.
8. Explain different ways of importing modules into applications in Python with syntax and L2 2
suitable programming examples.
Laboratory Programs
9. Write a function to calculate the factorial of a number. Develop a Python program to compute L2 2
the binomial coefficient. Read N and R from the console.
10. Develop a program to read a person's name and year of birth and print whether the person is a L2 2
senior citizen or not.
11. Develop a program to generate a Fibonacci square of length (N). Read N from the console. L2 2
7. Demonstrate the copy modules’ copy( ) and deepcopy( ) functions with suitable examples. L2 3
8. How is a tuple different from a list, and which functions are used to convert a list to a tuple L2 3
and vice versa?
Laboratory Programs
9. Read N numbers from the console and create a list. Develop a program to compute and print L2 3
mean, variance and standard deviation with suitable messages.
10. Develop a Python program to swap cases of a given string (Input: Java Output: jAVA) L2 3
11. Read a multi-digit number (as chars) from the console. Develop a program to print the L2 3
frequency of each digit with a suitable message.
12. Write a Python program to print even and odd numbers separately using step size in range ().
(i) print(a[ : : ] ) (ii) print(a[-3][0]) (iii) print(a[2][ : -1]) (iv) print(a[0][ : : -1]).
5. Demonstrate the working of the following string methods L2 3
i. upper( ) ii. lower( ) iii. isupper( ) iv. islower( )
6. Demonstrate the working of isX string methods. L2 3
Laboratory Programs
9. Develop a Python program to count the frequency of characters using the module PPrint L3 3
(Pretty Printing).
10. Develop a program to print t h e 10 most frequently appearing words in a text file. [Hint: L2 3
Use a dictionary with distinct words and their frequency of occurrences. Sort the dictionary
in the reverse order offrequency and display the dictionary slice of the first 10 items]
11. Develop a program to sort the contents of a text file and write the sorted contents into a separate L2 3
text file. [Hint: Use string methods strip(), len(), list methods sort(), append(), and file methods
open(), readlines(), and write()].
8. L2 3
Laboratory Programs
9. Develop a Python program to find the file size and folder contents in a given input file. L3 3
11. Implement a Python program to perform the following operations on an Excel spreadsheet: L3 3
i. Reading the first 5 rows of all columns
ii. Appending a new row / new column
iii. Delete row/column
iv. To perform aggregate functions
7. Discuss operator overloading. Mention any five operators with respective special functions to L3 5
be overloaded in Python
What is operator overloading? Write Python code to overload “+”, “_“ and “*” operators
by providing the methods _ _add_ _, _ _sub_ _ and _ _mul_ _ .
8. Define pure function and modifier. Demonstrate the role of pure functions and modifiers in L3 5
application development with suitable Python programs.
9. Define instantiation. Describe __init__and __ str__ methods with suitable programming L2 4
examples.
Laboratory Programs
10. Define a function that takes TWO objects representing complex numbers and returns new L3 3
complex numbers by adding two complex numbers. Define a suitable class ‘Complex’ to
represent the complex number.
Develop a program to read N (N >=2) complex numbers and to compute the addition of N
complex numbers.
11. Develop a program that uses class Student, which prompts the user to enter marks in three L2 3
subjects and calculates total marks, percentage and displays the scorecard details.
[Hint: Use a list to store the marks in three subjects and total marks. Use init () method to
initialize name, USN and the lists to store marks and total, Use getMarks() method to read
marks into the list, and display() method to display the scorecard details.]