0% found this document useful (0 votes)
102 views2 pages

BCA 3rd Sem 2021 Python Programming Lab

Uploaded by

eshanarayan101
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
102 views2 pages

BCA 3rd Sem 2021 Python Programming Lab

Uploaded by

eshanarayan101
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

ST.

XAVIER'S COLLEGE OF MANAGEMENT & TECHNOLOGY,


PATNA
Course: BCA| Semester: Third
Paper: PYTHON Lab| Paper Code: BCA 105P | Date: 07/12/2021
Time: 1:50 hours | Full Marks: 30

SET A
Answer any two questions.
Write a program on the computer and show output of the program to the
invigilator.
Write in your answer book program as well as the output.
1. Write a program in python to do the followings
i. Accept a user given string
ii. Change the case of the string to upper and title case.
iii. Perform slicing of the string from beginning, middle, and end to last few
characters and reverse the string using slicing.
iv. Check whether the input string is palindrome or not.
2. Write a program in python to accept marks of 5 papers from a student and
calculate total and average marks. Print appropriate grade as per the average
marks of the student.

ST. XAVIER'S COLLEGE OF MANAGEMENT & TECHNOLOGY,


PATNA
Course: BCA| Semester: Third
Paper: PYTHON Lab| Paper Code: BCA 105P | Date: 07/12/2021
Time: 1:50 hours | Full Marks: 30

SET B
Answer any two questions.
Write a program on the computer and show output of the program to the invigilator
Write in your answer book program as well as the output.
1. Write a program in python to print all prime numbers up to n.
2. Write a program to accept basic salary from user. Calculate DA=40 %, HRA
=30 % and Medical Allowance=10 % of Basic salary. Calculate Gross salary.
Calculate income tax as per the following criteria
i. If gross salary is above 50000, income tax=25 % of gross salary,
ii. If gross salary is >= 30000 and < 50000, income tax=15 % of gross salary,
iii. If gross salary is >= 20000 and < 30000, income tax=5 % of gross salary,
iv. If gross salary is < 20000, income tax=Nil of gross salary,
Calculate Net Salary and print all components of the salary.
ST. XAVIER'S COLLEGE OF MANAGEMENT & TECHNOLOGY, PATNA
Course: BCA| Semester: Third
Paper: PYTHON Lab| Paper Code: BCA 105P | Date: 07/12/2021
Time: 1:50 hours | Full Marks: 30

SET C
Answer any two questions:
Write program and show output of the program to the invigilator
Write in your answer book program as well as the output.
1. Write a program in python to accept n number of integer values from user and
add them to a list one by one. Perform following functions on the above list
i. Perform slicing of the list
ii. Reverse the list using slicing mechanism
iii. Add one new value to the list.
iv. Add multiple values to the list.
v. Check if a user given value exists in the list or not?
vi. Demonstrate the difference between the sort and the sorted methods.

2. Write a program in python to do the followings


i. Accept a user given string
ii. Change the case of the string to lower and title case.
iii. Print reverse of the string through slicing it.
iv. Check if whether the input string is palindrome or not.
v. Demonstrate any 5 inbuilt string functions.

You might also like