You are on page 1of 27

1.

Write a python script to take input for 3 different numbers, check and
print the largest number?

OUTPUT
2. Write a program to define user defined function to check whether
the given number is prime or not.

OUTPUT
3. Write a program to perform simple arithmetic calculator using
multiple user defined functions.
OUTPUT
4. Write a program using user defined functions to find the sum of all
the values, which are ending with 3 (i.e., units place is 3). In list.

OUTPUT
5. Write a python script to define a function EXPO (BASE, POWER) which
accepts two integers numbers and return result of BASEPOWER

OUTPUT
6. Write a function to take input for a number and print its factorial.

OUTPUT
7. Write a program to define function that Display Fibonacci Sequence.

OUTPUT
8. Write a function LeftMove(L,N) which accepts a list L of numbers and
N is a numeric value by which all elements of the list are moved to left.

OUTPUT
9. Write a random number generator that generates random numbers
between 1 and 6 (simulates a dice)

OUTPUT
10. Write a python program to read a file named “article.txt”, count and
print total number of alphabets in the file?

OUTPUT
11. Write a function to read a file named “story.txt”, count and print
total lines starting with vowels in the file?

OUTPUT
12. A binary file “Book.dat” has structure [BNo, BName, Author, Price].
Write a user defined function BOOKSTORE() to input data for a record
and add to Book.dat. Write another function COUNTBOOK(Author)
which accepts the Author name as parameter and count and return
number of books by the given Author are stored in the binary file
“Book.dat”
OUTPUT
13. A binary file “EMPLOYEE.DAT” has structure (eid, name, salary).
Write a function countrecord() in python that would read contents of
the file “EMPLOYEE.DAT” and display the details of those employee
whose salary is above 15000. Also display number of employees having
salary above 15000.
OUTPUT

14. Write a Python program to read specific columns of a given CSV file
and print the content of the columns.

OUTPUT
15. Write a Python program that reads each row of a given csv file and
skip the header of the file. Also print the number of rows and the field
names.
FILE

OUTPUT
16. Write a python program to maintain book details like book code and
book title using stacks data structures and Implement PUSH(), POP()
and TRAVERSE() functions.
OUTPUT
17. Write a function to insert a record of student that is roll number,
name, and marks in table using python and MySQL interface

OUTPUT
18. Write a function to display all the records stored in a table using
python and MySQL interface.

OUTPUT
19. Write a function to update a record stored in a table using python
and MySQL interface.
OUTPUT
20. Write a function to search a record stored in a table using python
and MySQL interface.

OUTPUT

You might also like