Kamal Institute of Higher Education and Advance Technology
Affiliated To Guru Gobind Singh Indraprastha University
SECTOR 16-C, DWARKA, NEW DELHI
PYTHON LAB
BCA-251
Practical File
Submitted By : Submitted To:
Name of Student: Dipanshu Ray Mr. Anil Gupta
Enrollment Number: 71596702023 Assistant Professor
Course: BCA Semester: Third CS & IT
Shift: First Year: 2023-26
INDEX
S. No Detailed Statement Date Signature
1 Write a program to enter two integers, and two floating numbers,
and then perform all arithmetic operations on them.
2 In this scenario, two friends are eating dinner at a restaurant. The
bill comes in the amount of 547.28. The friends decide to split the
bill evenly between them, after adding a 15% tip for the service.
Calculate the tip, the total amount to pay, and each friend's share,
then output a message saying. "Each person needs to pay: "
followed by the resulting number.
3 This code is supposed to take two numbers, divide one by another
so that the result is equal to 1, and display the result on the screen.
Write the code.
4 Write a program that receives a name, and then returns a greeting
based on whether or not that name is "Taylor".
5 Write a program to check if the no is odd or even.
6 Write a program using the bitwise operator.
7 Write a program to find the largest no out of 2 numbers.
8 Write a program to find the largest no out of 3 numbers.
9 Find odd no, even no
10 Write a program to take 5 subjects' marks, and compute the total,
average, and grade based on the marks.
11 Write a program to input any choice and to implement the
following. Choice Find 1. Area of square 2. Area of rectangle 3. Area
of triangle
12 Write a program using a logical operator.
13 Write a program to check whether a number is an Armstrong
number or not.
14 Write a program to print the sum of all the primes between two
ranges.
15 Write a program to swap two strings.
16 Write a program to find out whether the year is a leap year or not.
17 Write a menu-driven program to accept two strings from the user
and perform the various functions using user-defined functions.
18 Write a program to find the smallest and largest number in a list
19 Write a program that uses a user-defined function that accepts
name and gender (as M for Male, F for Female) and prefixes Mr./Ms.
on the basis of the gender.
20 Write a program to print the Fibonacci series using recursion
Q1. Write a program to enter two integers, and two floating numbers,
and then perform all arithmetic operations on them.
INPUT
OUTPUT:
Q2. In this scenario, two friends are eating dinner at a restaurant. The
bill comes in the amount of 547.28. The friends decide to split the bill
evenly between them, after adding a 15% tip for the service. Calculate
the tip, the total amount to pay, and each friend's share, then output a
message saying. "Each person needs to pay: " followed by the resulting
number.
INPUT
OUTPUT:
Q3. This code is supposed to take two numbers, divide one by another
so that the result is equal to 1, and display the result on the screen.
Write the code.
INPUT
OUTPUT:
Q4. Write a program that receives a name, and then returns a greeting
based on whether or not that name is "Taylor".
INPUT
OUTPUT:
Q5. Write a program to check if the no is odd or even.
INPUT
OUTPUT:
Q6. Write a program using the bitwise operator.
INPUT
OUTPUT:
Q7. Write a program to find the largest no out of 2 numbers.
INPUT
OUTPUT:
Q8. Write a program to find the largest no out of 3 numbers.
INPUT
OUTPUT:
Q9. Find odd no, even no
INPUT
OUTPUT
Q10. Write a program to take 5 subjects' marks, and compute the total,
average, and grade based on the marks.
INPUT
OUTPUT
Q11. Write a program to input any choice and to implement the
following. Choice Find 1. Area of square 2. Area of rectangle 3. Area of
triangle
INPUT
OUTPUT
Q12. Write a program using a logical operator.
INPUT
OUTPUT
Q13. Write a program to check whether a number is an Armstrong
number or not.
INPUT
OUTPUT
Q14. Write a program to print the sum of all the primes between two
ranges.
INPUT
OUTPUT
Q15. Write a program to swap two strings.
INPUT
OUTPUT
Q16. Write a program to find out whether the year is a leap year or not.
INPUT
OUTPUT
Q17. Write a menu-driven program to accept two strings from the user
and perform the various functions using user-defined functions.
INPUT
OUTPUT
Q18. Write a program to find the smallest and largest number in a list
INPUT
OUTPUT
Q19. Write a program that uses a user-defined function that accepts
name and gender (as M for Male, F for Female) and prefixes Mr./Ms. on
the basis of the gender.
INPUT
OUTPUT
Q20. Write a program to print the Fibonacci series using recursion.
INPUT
OUTPUT