Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sr. No List of Practicals 1. 2. 3. 4. 5. 6

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Sr.

No List of Practicals
1. Write a simple Python Program to INPUT two variables and print
Addition, Subtraction, Multiplication and Division of both
numbers.
2. Write a program to input 2 number and an arithmetic operator.
Display the result accordingly.
3. Write a program to input Principal Amount, Rate and Year and
display Simple Interest.
4. Write a program to input Principal Amount, Rate and Year and
display Compound Interest
5. Write a program to input radius of a circle, and print area of
that circle.
6. Write a program to input a number and print whether it is Even
or Odd Number.

7. Write a program to input age of person and display message as


follows
- If age < 12 print You are Kid
- If age between 12 to 17 print You are teenager
- If age between 18 to 60 print you are Adult
If age > 60 print You are Senior Citizen
8. Write a Python Program to input marks of 4 subjects and
display Total, Percentage, Result and Grade. If student is fail
(<40) in any subject then Result should be displayed as “FAIL”
and Grade should be displayed as “With Held**”
9. Write a program to input a number and display Table of that
number.
Write a program to print all numbers which are divisible by 7
10. between 1 to 200.
11 Write a program to input a number and display Factorial of that
number. For example, Factorial of 5 = 5 * 4 * 3 * 2 * 1 = 120.
12 Write a program to input a number and display whether number
is prime or not.
13 Write a program which will find all such numbers which are
divisible by 7 but are not a multiple of 5, between 2000 and
3200 (both included).
14 Write a program to print all prime numbers between 1 to 100.
15 Write a program to print factorial number using function
16 Write a program to create list in such a way that it should add
square roots of number between 1 to n in the list... At the end,
the list shall be displayed.
Example : [1, 4, 9, 16, 25, ....]
17 Write a program to create dictionary in such a way that it
should add number as a key and square root of number as a
value between 1 to n in the dictionary... At the end, the data
shall be displayed.
Example : {1:1, 2:4, 3:9, 4:16, 5:25, ...}
18 Write a program which accepts a sequence of comma-separated
numbers from console and generate a list and a tuple which
contains every number.
19 Write a Python Program to create a function which accepts 3
arguments. (2 numbers and one arithmetic operator). Display
answer accordingly
20 Write a Python Program to create function which accepts one
argument as a number and return Factorial value of the
number. (Function must be RECURSIVE function, not loop)
21 Write a program to create lambda function to add two numbers
and display total.
22 Write a Python Program accept comma separated string and
display tokens using split(), rsplit() and splitlines()
23 Write a program that accepts a comma separated sequence of
words as input and prints the words in a comma-separated
sequence after sorting them alphabetically.
Suppose the following input is supplied to the
program :without,hello,bag,world
Then, the output should be :bag,hello,without,world
24 Write a program that accepts sequence of lines as input and
prints the lines after making all characters in the sentence
capitalized. If you enter blank line, shall be treated as exit of
program. All the upper case converted lines shall be added to
list one by one
25 Write a program to generate random password which shall
combine upper case alphabets, lower case alphabets, digits and
special characters. You shall prepare separate dictionary items
called “lower”, “upper”, “digits”, “special” and values shall be
stored accordingly. From this array, based on the user’s choice
random password shall be generated. You shall make sure that
atleast one character is selected from all specified choices. Use
dictionary / list as applicable
26 Write a program to read names from keyboard and store into
text file
27 Write a program to read any text file line by line
28 Write a program to read text file having number and display all
numbers with total and average at the last. (Manually prepare a
file having some numbers and then read it)
29 Write a program to compute the frequency of the words from
the input. The output should output after sorting the key
alphanumerically.
Suppose the following input is supplied to the program:
“Hello There this is Python. Python is good”
Then output shall be as follows :
Hello : 1
There : 1
This : 1
is : 2
Python : 2
Good : 1
30 Write a Python Program that creates a student class with
appropriate members and functions to add student, display
student, delete student and search student (Use lists or tuple or
named tuple, whatever applicable)
31 Write a Python Program that creates a Student class with
various methods. Use setattr() and getattr() on class object
32 Define a class which has at least two methods:
getString: to get a string from console input
printString: to print the string in upper case.
33 Write a Python Program that creates a class with function
overloading
34
Write a Python Program that creates a class and inherit into
another class
(Base Class : Student with rollno, name, gender, age)
(Derived Class : Course with coursename, duration, fee)
Use appropriate functions for each class

35 Write a Python program to overload __str__ method of class


and print class values in string format. You can do overloading
as per your choice but shall be done through __str__ method
only.
36 Write a program that uses all parts of exception handling in
python (try, except, else, finally)
37 Write a file handling program which shall store Name and
BirthDate, it should have 3 choices as follows

1) Add Birth Date


2) List All Details
3) Show Today’s Birth Days
4) Exit

The moment you start the program, it shall first display list of
persons who have got birthday today.
38 Create a class of Library with following attributes
(title, author, publisher, edition, year of publication, price, type
(reference or text book)
Class shall have following methods
addBook(), modifyBook(), deleteBook(), searcBook(),
listBooks(), sortedView()

Prepare menu drive program with the data stored in file. Main
menu shall have above choices and sorted view shall have
further choice of sorting as title, author, publisher, year of
publication and price which shall display the data accordingly)
(Use list to store the data as follows
[[Core Python Programming|WesleyChun|Premier Press|2|
2005|550|Text],
[Pythong Programming for Beginners|Michael|Premier Press|2|
2015|660|Reference],
[Head First Python|PaulBerry|O Reilly |4|2014|550|
Reference]]

Data is separated by pipe sign


39 Create simple project in DJango with “Hello World” page

40 Create simple login application using DJango

You might also like