PPS QB
PPS QB
UNIT 1
What is a problem? Explain six problem solving steps.
List down types of operators in Python. Explain relationaloperators.
To calculate salary of an employee given his basic pay (take as input from
user). Calculate gross salary of employee. Let HRA be 10 % of basic pay
and TA be 5% of basic pay. Let employee pay professional tax as 2% of
total salary. Calculate net salary payable after deductions.
Explain following terms with suitable examples.
i) Comment
ii) Reserve Words
Write a program to swap two numbers.
Write a program to convert degree Fahrenheit into degreeCelsius.
Explain pseudo code with example.
Program to perform all operation (addition, multiplication, subtraction,
division, modules) and expression.
Write a program to find largest of three numbers
Program to perform area of circle.
UNIT 2
Write a program to check whether a number is Armstrong number or not
using a function
Write a short note on modules and package in python.
Program to understand how characters in a string are accessed using
negative indexes.
Write a program to print the multiplication table of n, where n value is
entered by user.
Write syntax of function definition and function call. Give a suitable
example for the same.
Write a program to find cube of a number using lambda function.
To accept student’s five courses marks and compute his/her result.
Student is passing if he/she scores marks equal to and above 40 in each
course. If student scores aggregate greater than 75%, then the grade is
distinction. If aggregate is 60>= and <75 then the grade if first division. If
aggregate is 50>= and <60, then the grade is second division. If aggregate
is 40>= and <50, then the grade is third division
Write syntax of function definition and function call. Give a suitable
example for the same.
Explain the following types of function arguments with examples.
variable length arguments
Default arguments
Write a program to demonstrate operation on lists.
UNIT 3
Explain the following string operations with examples. i) Concatenation
ii) Appending
iii) string multiplication
Explain string formatting operator with suitable example.
Write a python program that accepts a string from user and perform
following string operations- i. Calculate length of string ii. String reversal
iii. Equality check of two strings iii. Check palindrome ii. Check substring
Explain string module in python.
Write a program to reverse a string without using slicingoperator.
Write a program to understand ord() and char() function.
Explain the following with suitable example.
ord() and chr() function
in and not in operators on string
To accept a number from user and print digits of number in a reverse
order.
Explain following string methods with example.
Rindex ii) Z fill iii) Split
Write a program to reverse a string without using slicing operator.
To accept a number from user and print digits of number in a reverse
order.
UNIT 4
What is a file? Explain different Access Modes.
Write a program that reads text from a file and writes in into another file
but in the reverse order. (Hint: Make the first line in the original file as the
last line in the copied file).
Program to split the line into a series of words and use space to perform
the split operation.
Explain the following method with suitable example
getcwd() ii) rmtree() iii) makedirs()
What is a file path? Explain absolute path and relative path.
Program that reads data from a file and calculates the percentage of
vowels and consonants in the file.
What is a file? Explain different Access Modes.
Write a program that reads text from a file and writes in into another file
but in the reverse order. (Hint: Make the first linein the original file as the
last line in the copied file).
Write a program to open a file and print its attribute values.
Explain the following method with suitable example i) getcwd()
rmtree()
makedirs()
What is a file path? Explain absolute path and relative path.
UNIT 5
Explain the following features of OOP
Classes and Objects
Methods and Message Passing
Inheritance
Write a program to calculate area of square and rectangleusing a class.
Write a program to access class variable using class object.
Explain the following programming Paradigms in detail. i) Procedural
ii) Structured
Object Oriented
Write a program to create a class ‘Book’ with members, title, author,
publisher, and ISBN number. The functions of the class should read and
display the data.
Write a program to differentiate between class and object variable
Explain the following features of OOP
Classes and Objects ii Methods and Message Passing ii) Inheritance
Write a python program to create class car with two attributes name &
cost. Create two objects and display information.
Program to access class variable using class object.
Explain the following programming Paradigms in detail.
I)Procedural ii)Structured iii)Object Oriented
Write a program to create a class ‘Book’ with members, title, author,
publisher, and ISBN number. The functions of the class should read and
display the data.
Write a program to implement inheritance and polymorphism in Python