0% found this document useful (0 votes)
2 views3 pages

Final PracticalList Python Programming (NEP)

The document outlines a practical list for Python programming for B.C.A. SEM - 5 under NEP, detailing various tasks across two units. Unit 1 includes basic scripting tasks, list and tuple operations, set operations, and dictionary generation, while Unit 2 focuses on string manipulation, list processing, and class creation for arithmetic and geometric shapes. It emphasizes that only the bold definitions need to be recorded in journals.

Uploaded by

nishthasingh0907
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)
2 views3 pages

Final PracticalList Python Programming (NEP)

The document outlines a practical list for Python programming for B.C.A. SEM - 5 under NEP, detailing various tasks across two units. Unit 1 includes basic scripting tasks, list and tuple operations, set operations, and dictionary generation, while Unit 2 focuses on string manipulation, list processing, and class creation for arithmetic and geometric shapes. It emphasizes that only the bold definitions need to be recorded in journals.

Uploaded by

nishthasingh0907
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

B.C.A.

SEM - 5 Python Programming Practical List(NEP)

Unit - 1
1. Create a script to print “Hello World” in Python.
2. Create a program to find whether given number is odd or even. [Take input from
user]
3. Take input from user and find factorial of a number.
4. Using while loop print Fibonacci series.
5. Print the following pattern
A
A B
ABC
ABCD
ABCDE
[Take input from user]
6. Create a program to find whether given number is palindrome or not.
7. Create a list in python and perform following operations:

a) Print length of the list


b) Append an item to the list
c) Insert an item to the list
d) Find index number of an item
e) Remove an item from list
f) Delete an item with specified index

8. Given a tuple
n= (19, 147, 36, 87, 97, 239, 6, 34)
a) Display elements of tuple
b) Display lowest tuple elements
c) Display largest tuple elements
d) Difference between largest and lowest tuple element

9. Return a new set of identical items from two sets in Python.


e.g.
set1 = {10, 20, 30, 40, 50}
set2 = {30, 40, 50, 60, 70}
O/p:
{40, 50, 30}

10. Construct the following pattern.


11. Write a Python program to generate and print a dictionary that contains a number
(between 1 and n) in the form (x, x*x).
e.g.
Input: 10

Output : {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100}
Unit-2
12. Write a Python function that accepts a string and count the number of upper,
lower case letters, digits and other characters.
Input : How Are You, sir?
Output :
No. of Upper case characters : 3
No. of Lower case Characters : 9
No. of Digits : 0
No. of Other Characters : 9
13. Write a Python function that accepts a string and returns the string in
Uppercase.
Input: Good Morning, sir.
Output: GOOD MORNING, SIR.
14. Create a python function that accepts a list of integer elements as an argument
and returns a list with ONLY even numbers of elements.
Input List : [10, 21, 34, 53, 85, 70, 69]
Output List : [10, 34, 70]
15. Write a Python function that takes a list and returns a new list with unique/distinct
elements from the first list.
Input List : [1, 2, 3, 3, 3, 3, 4, 4, 4, 5]
Output List : [1, 2, 3, 4, 5]
16. Write a python function that accepts a list of string elements as an argument and
returns a list with reverse of each element.
Input List : [“Anand”, “Borsad”, “Dakor”, “Nadiad”]
Output List : [“dnanA”, “dasroB”, “rokaD”, “daidaN”]
17. Write a Python program to create a calculator class. Include methods for basic
Arithmetic operations.
18. Write a Python program to create a class representing a Rectangle. Include
methods to calculate its area and perimeter.
Area of a Rectangle = L * B and
Perimeter of a Rectangle = 2(L + B)
where L is length and B is breadth of a rectangle.
19. Write a python function that accepts a list of string elements as an argument and
returns a listwith ONLY first letter of each element.
Input List : [“Anand”, “Borsad”, “Dakor”, “Nadiad”]
Output List : [“A”, “B”, “D”, “N”]
20. Write a python function that accepts a list of string elements as an argument and
returns a list with length of each element.
Input List : [“Anand”, “VVN”, “Dakor”, “Nadiad”]
Output List : [5, 3, 5, 6]
21. Write a Python function that accepts a list of integer elements as an argument and returns
two separate lists of odd and even elements.
Original list of integers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Odd numbers list: [1, 3, 5, 7, 9] Even numbers list: [2, 4, 6, 8, 10]

Note: Only Bold Definitions are compulsory to be written in Journals.

You might also like