Shivprakash
Shivprakash
like:
Number of lowercase characters
Number of uppercase characters
Number of alphabets
Number of digits
Number of other case characters.
PROGRAM:
OUTPUT:
OUTPUT:
Q2) Write a menu driven program to check whether the given
number is prime number or palindrome number.
PROGRAM:
OUTPUT:
Q3) Write a program in python to display the given pattern: 1
12
123
1234
12345
PROGRAM:
OUTPUT:
Q4) Write a menu driven program to calculate the Factorial of a given
number or Fibonacci series upto the given number.
PROGRAM:
OUTPUT:
Q5) Write a program in python to read a list and sort the values of list
and sort the values of list without using built in functions.
PROGRAM:
OUTPUT:
OUTPUT:
Q6) Write a python program to create a tuple consisting of the square
of integers from 1 to 100.
PROGRAM:
OUTPUT:
Q7) Write a program to create a student dictionary containing the
name (key) and marks (value) of 5 students taken from the user. Also
display the name of the student whose marks is greater than 80.If not
display appropriate message.
PROGRAM:
OUTPUT:
Q8) Write a user defined function SWAP2CHANGE( ) which takes list
as arguments in python to modify the content of the list in such a way
that the elements, which are multiples of 10 swap with the value
present in the very next position in the list. Invoke the function along
with the list.
PROGRAM:
OUTPUT:
Q9) Write a function onedigit( ) that takes two numbers as input and
returns the number that has minimum one’s digit. Read the numbers
from the user and invoke the function . Also display the number that
is returned having minimum one’s digit.
PROGRAM:
OUTPUT:
Q10) Write a program in python using user defined functions
smallest() and largest() to find the smallest or largest among three
numbers. Read the numbers from the user and invoke the function
based on the user choice.
PROGRAM:
OUTPUT:
OUTPUT:
Q11) Write a menu driven program to perform all the arithmetic
operations based on user choice.
PROGRAM:
OUTPUT:
Q12) Write a program in python to write lines
We work, we try to be better
We work with full Zest
But, why is that we just don’t know any letter
in to the test file poem.txt. Also read the content of text file line by
line and display each word separated by #.
SOURCE CODE:
OUTPUT:
Q13) Write a python program to add a string “ An Aeroplane is in the
Sky 12@#45 flying to @ Chennai” to the file article.txt Also read the
content of the file and count and display the number of alphabets,
digits, uppercase letters, lowercase letters, spaces and other
characters present in the text file article.txt.
PROGRAM:
OUTPUT:
Q14) Write a program in python to create binary file employee.dat
with 4 records containing the following information employee no,
employee name and salary. Also read the content of the binary file
and display all those employees whose salary is above 25000 and also
count and display the no of employees whose salary is above 25000.
If not found then display appropriate message.
PROGRAM:
OUTPUT:
Q15) Write a function in python to update the starting point as
Chennai, whose destination is “Cochin” from binary file “Bus.dat”.
Assuming the binary file is containing the following elements in the
list:
1.Bus Number
2.Bus Starting Point
3.Bus Destination
Write a complete program to create a file Bus.dat with 4 records and
invoke the function.
PROGRAM:
NEXT PAGE
OUTPUT:
Q16) Write a program in python to create a csv file product.csv with 4
records containing the information product id, product name, price.
Also read the content of the file and display all the records from
product.csv whose price is more than 300.
PROGRAM:
OUTPUT: