PRACTICAL
FILE
COMPUTER SCIENCE(083)
NAME: YUKTI
ROLL NO: 32
ADMISSION NO:4477
ACADEMIC YEAR:2024-25
PYTHON BASICS
01: Input two numbers from the user and display their sum and
product
OUTPUT:
02: Write a program to illustrate nested if-else through a four
function calculator
OUTPUT:
03:Find the output
04: WAP to input and print the pattern as given below
y
yu
yuk
yukt
yukti OUTPUT:
05:WAP to count the frequency of element in a tuple
OUTPUT:
06:Create a dictionary and use popitem() function
OUTPUT:
07: WAP to read a list of elements and modify it so that it does not
contain any duplicate element.
OUTPUT:
08: WAP to accept a string and print the string after capitalizing every
other letter in the string
OUTPUT:
Functions
09:WAP to calculate factorial of numbers between 1 and 5.
10:WAP to perform basic calculations on two value and return the
calculated result
OUTPUT:
11:WAP to accept string as an input and to count and display the
total number of times a character is present
OUTPUT:
12:WAP to listchange(Arr) in python, which accepts a list of numbers
and replace each even number.
13:WAP to check whether a number is perfect or not
14: WAP to demonstrate the concept of variable length argument to
calculate sum and product of the first 10 numbers
Data File Handling
15:Read a text file line by line and display each word separated by a
$.
16:WAP to remove all the lines that contain the character ‘a’ in a file
and write it to another file.
17:WAP to read a text file and display the number of vowels,
consonants uppercase and lower case character in the file
18:WAP to count the word “to” and “the” present in the file
19:Create a binary file with name and roll number. Search for a given
roll number and display the name, if not found display appropriate
msg.
20:A file sports.dat contains information in
following format[event,participant].WAP that would read the
content from the file and copy only those record from sports.dat
where the event name is “Athletics” in new file named Athletics.dat
Data Structures
21:Write a python program to maintain book details like book code,
book title and price using stacks data structures.
22:WAP to implement all basic operations of a stack and displaying
the elements.
OUTPUT:
23:WAP to display unique vowels present in the given word using
stack.
OUTPUT: