DEEPAK PYTHONFile1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

PYTHON PROGRAMMING

PRACTICAL FILE

SUBMITTED IN THE PARTIAL FULFILLMENT OF THE DEGREE OF

BACHELOR OF BUSINESS ADMINISTRATION(CAM)-214

(MAY 2024)

SUBMITTED BY:

DEEPAK YADAV

ENROLLMENT NO.

01913401922

UNDER THE GUIDANCE OF

Dr. PARMINDER KAUR

(Academic In-charge, BCA DEPARTMENT)

IDEAL INSTITUTE OF MANAGEMENT & TECHNOLOGY


(16 X, Karkardooma Institutional Area, Delhi-92)
(AFFILIATED TO GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY, DELHI)

1
ACKNOWLEDGEMENT

I am preparing this practical file of Python programming for the program of


Bachelor of Business Administration(CAM) for Ideal Institute of Management &
Technology, Affiliated to Guru Gobind Singh Indraprastha University.

It has been a great challenge but a plenty of learning and opportunities to gain a huge
amount of knowledge on the way of preparing this file. I could not have completed
my work without the constant guidance of Dr. Parminder Kaur, my faculty, who
helped me along the way and was always prepared to give me feedback and
guidelines whenever I needed it.

DEEPAK YADAV

Enroll no.:01913401922

2
CERTIFICATE

This is to certify that Practical file of Python Programming which is submitted by


DEEPAK YADAV in partial fulfillment of the requirement for the award of degree
of Bachelor of Business Administration (CAM) to Ideal Institute of Management
and Technology (affiliated to GGSIP University, Delhi) is a record of the candidate’s
own work carried out by her under my supervision. The matter embodied in this file
is bonafide and has not been submitted for the award of any other degree.

Dr. Parminder Kaur


(Academic In-charge, BCA Department)

3
PYTHON
PROGRAMING
INTRODUCTION

4
INDEX: - Python Programming

S.no. Name of the Practical


1. • Enter two numbers and perform swapping.
Python • Enter two numbers and perform the floor division.
Programming • Enter no and perform bitwise operation.
Introduction • Show the working of break and continue statement
• Input any number from user and check it is Even no. or not
• Write a program to calculate the nth term of Fibonacci series

• Perform following with string

i. Slicing
ii. Membership
iii. Capitalize
iv. Lower and upper
v. Isdigit
vi. Split
vii. Startwith() and Endwith()

2. • Perform following with list


Mutable and
Immutable Object i. Append
ii. Count
iii. Remove
iv. Pop
v. Sort
vi. Reverse

• Perform following with tuples

i. Count
ii. Index
iii. Len
iv. Min and max
v. +&*

• Perform following with dictionary

i. Get
ii. Update
iii. Copy
iv. Delete

5
v. clear

• Write a program to find sum of elements of List

3. Concept of • Create parameterized function in python and show the basic


function functionality with function
• Enter a number and power then compute the power using an
exponential operator.

• Input any number from user and calculate factorial of a


number

• Create function and perform Function argument

i. Required argument
ii. Keyword argument
iii. Default argument
iv. Variable length or arbitrary argument

• Create Module and import module with basic functionality

i. Renaming
ii. From…
iii. Dir( )
iv. Platform

• Implement Math module(sqrt(), pi,ceil,floor,pow())


• Implement Random module

i. random( )
ii. randint( )
iii. randrange( )
iv. randchoice( )

• Program to read and display file content.

4. Object • Program with classes and object


Oriented
Programming • Program on numPy

• Program on Array

6
• Enter two numbers and perform swapping.

Syntax:

Output:

• Enter two numbers and perform floor division.


Syntax:

7
Output:

• Enter no and perform bitwise operation.


AND (&)

Syntax:

Output:

8
OR (|)

Syntax:

Output:

NOT (~)

Syntax:

Output:

9
• Show the working of break and continue statement.

BREAK
Syntax:

Output:

10
CONTINUE

Syntax:

Output:

11
• Input any number from user and check it is Even no. or not.
Syntax:

Output:

• Write a program to calculate the nth term of Fibonacci series.

Syntax:

12
Output:

• Perform following with string:


I. Slicing
Syntax:

Output:

II. Membership

Syntax:

13
Output:

III. Capitalize
Syntax:

Output:

14
IV. Uppercase and lowercase
UPPERCASE
Syntax:

Output:

lowercase
Syntax:

Output:

15
V. Isdigit

Syntax:

Output:

VI. Split
Syntax:

16
Output:

VII. Startwith() and endwith()

Syntax:

Output:

17
Mutable and
Immutable Object

18
• Perform following with list
i. Append

Syntax:

Output:

ii. Count

Syntax:

Output:

19
iii. Remove

Syntax:

Output:

iv. Pop

Syntax:

Output:

20
v. Sort

Syntax:

Output:

vi. Reverse

Syntax:

Output:

21
• Perform following with tuples
i. Count

Syntax:

Output:

ii. Index

Syntex:

Output:

22
iii. Length

Syntax:

Output:

iv. Min and Max

Syntax:

Output:

23
v. +&*

Syntax:

Output:

• Perform following with dictionary


i. Get
Syntax:

24
Output:

ii. Update
Syntax:

Output:

iii. Copy
Syntax:

25
Output:

iv. Delete
Syntax:

Output:

26
v. Clear
Syntax:

Output:

• Write a program to find sum of elements of List


Syntax:

Output:

27
Concept of function

28
• Create parameterized function in python and show the
basic functionality with function.
Syntax:

Output:

• Enter a number and power then compute the power


using an exponential operator.
Syntax:

29
Output:

• Input any number from user and calculate factorial of a


number.
Syntax:

Output:

30
• Create function and perform Function argument.
i. Required Argument
Syntax:

Output:

ii. Keyword Argument


Syntax:

Output:

31
iii. Default Argument
Syntax:

Output:

iv. Variable length or arbitrary argument


Syntax:

Output:

32
• Create Module and import module with basic
functionality.
i. Renaming
ii. From…
iii. Dir( )
iv. Platform
Syntax:

33
Output:

• Implement Math module(sqrt(), pi,ceil,floor,pow()).


Syntax:

34
Output:

• Implement Random module


v. random( )
vi. randint( )
vii. randrange( )
viii. randchoice( )
Syntax:

35
Output:

• Program to read and display file content.

Syntax:

Output:

36
Object Oriented
Programming

37
• Program with classes and object.

Syntax:

Output:

38
• Program on numPy.
Syntax:

Output:

39
• Program on Array.
Syntax:

Output:

40
THANK
YOU

41

You might also like