You are on page 1of 19

Directorate of Distance Education

Guru Jambheshwar University of Science & Technology


Hisar
Session 2021-22

Practical File of Python


Programming
MCA-17 : Software Lab –Web Designing

Submitted to: Submitted by:

Ms. Ritu Chopra Lalit


Assistant Professor, 21151002003
Deptt. Of Computer Science MCA 2nd-Sem

0|Page
INDEX
Sr. No. Content Page No.

1 Install Python and explore various popular IDE like IDLE, PyCharm, 2-7
and Anaconda.

2 Assignments to perform various number operations like 8-11


a. Find maximum from a list of numbers
b. GCD of two number
c. Square root of a number
d. Check number is prime or not.
e. Print first N prime numbers
f. Remove duplicate numbers from list
g. Print the Fibonacci series.

3 Assignments to perform various operations on Strings like creation, 12-13


deletion, concatenation

4 Create a List L = [10, 20, 30]. 13-16


Write programs to perform following operations:
a. Insert new numbers to list L.
b. Delete numbers from list L.
c. Sum all numbers in list L.
d. Sum all prime numbers in list L.
e. Delete the list L.

5 Create a Dictionary D= {‘Name’: ‘Allen’, ‘Age’: 27, 5:123456}. 17-18


Write programs to perform following operations:
a. Insert new entry in D.
b. Delete an entry from D.
c. Check whether a key present in D.
d. Update the value of a key.
e. Clear dictionary D.

1|Page
1- PyCharm installation and exploration
PyCharm is a dedicated Python Integrated Development Environment (IDE) providing a wide range of
essential tools for Python developers, tightly integrated to create a convenient environment for productive
Python, web, and data science development from Jetbrains.

Setting up PyCharm on Windows

Python developers choose PyCharm for Windows due to simplicity and predictability. PyCharm
is compatible with any version of Python, and may even be installed before choosing a
distribution of the Python interpreter.

Download PyCharm Open your favorite browser, and head to


the https://www.jetbrains.com/pycharm/download/#section=windows, which will detect your
OS. PyCharm is available for both 32 bit and 64 bit machines.

After downloading finished, Access the file:

Start the installation process step by step by allowing the options as per your requirement:

2|Page
Give path or it will be default:

3|Page
Check/uncheck the box for shortcuts/Associations/context Menu updation etc:

Select the folder/new folder in which you would like to create the program’s shortcut:

4|Page
Process will be automate now:

One it get finished, hit finish button:

5|Page
Access the pycharm in you system , Goto to file menu for creation of new project:

Give path for the project file to be stored,you can change the enviourment here also can can the option for
global package inheritance and avilablity to all:

6|Page
Write the program here and hit run button to execute the code :

You will get the output window in downside displaying the output:

While writing the code there is auto suggestion for inbuilt keyword in PyCharm which is a great feature to
save the your time for writing the code as by pressing Enter suggested word will be written from the
Validation list displayed.

7|Page
2 - Assignment to perform various operations
(a) Find maximum from a list :

Code:

Output:

(b) GCD of two numbers :


Code:

Output:

8|Page
(c) Square root of two numbers:
Code:

Output:

(d) Check number is prime or not:


Code:

Output:

9|Page
(e) Print first N prime numbers:
Code:

Output:

(f) Remove duplicate number from list:


Code:

Output:

10 | P a g e
(g) Print the Fibonacci series:
Code:

Output:

11 | P a g e
3 – Various operation on string
#Creation
Code:

Output:

#UpdationAndConcatenation
Code:

Output:

# Deletion
Code:

12 | P a g e
Output:

13 | P a g e
4 – Create a list L & perform Operations
#Code
#Create List L = [10,20,30]

Output:

a. insert new element to list L


Code:

Output:

b. delete number from list L


Code:

Output:

14 | P a g e
c. sum all number in list L
Code:

Output:

d. sum all prime number in list L


Code:

Output:

15 | P a g e
e. Delete the list L
Code:

Output:

16 | P a g e
5 – Create a dictionary

#Create a dictionary D= {‘Name’: ‘Allen’, ‘Age’: 27, 5:123456}.


Code:

OutPut:

a. Insert new entry in D.


Code:

OutPut:

b. Delete an entry from D.


Code:

OutPut:

17 | P a g e
c. Check whether a key present in D.
Code:

OutPut:

d. Update the value of a key.


Code:

OutPut:

e. Clear dictionary D.
Code:

OutPut:

18 | P a g e

You might also like