0% found this document useful (0 votes)
182 views39 pages

External Practical File PDF

The document outlines 28 Python programming practical assignments completed by a student, including tasks to perform arithmetic operations, calculate tip and bill amounts, check for odd/even numbers, find largest numbers, calculate grades and more, with each assignment signed off by the instructor.

Uploaded by

Viraj Bhalla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views39 pages

External Practical File PDF

The document outlines 28 Python programming practical assignments completed by a student, including tasks to perform arithmetic operations, calculate tip and bill amounts, check for odd/even numbers, find largest numbers, calculate grades and more, with each assignment signed off by the instructor.

Uploaded by

Viraj Bhalla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

TRINITY INSTITUTE OF PROFESSIONAL

STUDIES
Sec-9 Dwarka, New Delhi-110075

(AFFILIATED TO)

GURU GOBIND SINGH INDRAPRASTHA


UNIVERSITY

Sector-16C, Dwarka, New Delhi

Submitted to: Dr. Mukta Submitted by: Viraj Bhalla

Subject: Basics of Python Enroll. No. - 02920602021

Class: BCA 3rd Sem. 1st Shift


Index
S No. Practicals Sign
1. Write a program to enter two integers, 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 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, then returns a
greeting based on whether or not that name is
"Taylor".
5. Write a program to check the no is odd or even.
6. Write a program using 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 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 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 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 smallest and largest number
in a list.
19. . Create a dictionary whose keys are month names and
whose values are the number of days in the
corresponding months. • Ask the user to enter a
month name and use the dictionary to tell them how
many days are in the month. • Print out all keys in the
alphabetically order • Print out all the months with 31
days • Print out the key value pairs sorted by number
of days in each month.
20. Make a list of first 10 letters of the alphabet, then use
the slicing to do the following operations: • Print the
first 3 letters of the list • Print any 3 letters from the
middle Print the letter from any particular index to
the end of the list.
21. Write a program that scans an email address and
forms a tuple of user name and domain.
22. 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.
23. Write a program to print the Fibonacci series using
recursion.
24. Write a program that defines a function large in a
module which will be used to find larger of two values
and called from code in another module.
25. Write a program to know the cursor position and
print the text according to specifications given below:
a) Print the initial position
b) Move the cursor to 4th position
c) Display next 5 characters
d) Move the cursor to the next 10 characters
e) Print the current cursor position
f) Print next 10 characters from the current cursor
position
26. Create a binary file with roll number, name and
marks. Input a roll number and perform the following
operations:
a) Update the marks.
b) Delete the record
c) Display the record
d) Append the record
e) Search the record
27. Write a program to Create a CSV file by entering
user-id and password, read and search the password
for given user id.
28. Write a program to display Bar Graphs and Pie charts
using matplotlib.
Practical No-1
Write a program to enter two integers, two floating numbers and then
perform all arithmetic operations on them.

Integer:
Float:
Practical No-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 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.
Practical No-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.
Practical No-4
Write a program that receives a name, then returns a greeting based on
whether or not that name is "Taylor".
Practical No-5
Write a program to check the no. is odd or even.
Practical No-6
Write a program using bitwise operator.
Practical No-7
Write a program to find the largest no. out of 2 numbers.
Practical No-8
Write a program to find the largest no. out of 3 numbers.
Practical No-9
Find odd no., even no.
Practical No-10
Write a program to take 5 subjects marks, and compute total, average
and grade based on the marks.
Practical No-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
Practical No-12
Write a program using logical operator.
Practical No-13
Write a program to check whether a number is an Armstrong number or
not.
Practical No-14
Write a program to print the sum of all the primes between two ranges.
Practical No-15
Write a program to swap two strings.
Practical No-16
Write a program to find whether the year is a leap year or not.
Practical No-17
Write a menu driven program to accept two strings from the user and
perform the various functions using user defined functions.
Slicing:

Formatting:
Practical No-18
Write a program to find smallest and largest number in a list.
Practical No-19
Create a dictionary whose keys are month names and whose values are
the number of days in the corresponding months. • Ask the user to
enter a month name and use the dictionary to tell them how many days
are in the month. • Print out all keys in the alphabetically order • Print
out all the months with 31 days • Print out the key value pairs sorted by
number of days in each month.
Practical No-20
Make a list of first 10 letters of the alphabet, then use the slicing to do
the following operations: • Print the first 3 letters of the list • Print any
3 letters from the middle Print the letter from any particular index to the
end of the list.
Practical No-21
Write a program that scans an email address and forms a tuple of user
name and domain.
Practical No-22
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.
Practical No-23
Write a program to print the Fibonacci series using recursion.
Practical No-24
Write a program that defines a function large in a module which will be
used to find larger of two values and called from code in another
module.
Practical No-25
Write a program to know the cursor position and print the text
according to specifications given below:
g) Print the initial position
h) Move the cursor to 4th position
i) Display next 5 characters
j) Move the cursor to the next 10 characters
k) Print the current cursor position
l) Print next 10 characters from the current cursor position
Practical No-26
Create a binary file with roll number, name and marks. Input a roll
number and perform the following operations:
f) Update the marks.
g) Delete the record
h) Display the record
i) Append the record
j) Search the record
Practical No-27
Write a program to Create a CSV file by entering user-id and password,
read and search the password for given user id
Practical No-28
Write a program to display Bar Graphs and Pie charts using matplotlib.

Bar Graph:
Pie Chart:

You might also like