You are on page 1of 3

Basics of Programming

Student Name: Python Programming


Subject Code: CAP761

UID: 20MCA1114 Section/Group: MCA01/B


Semester: 2nd Date of Performance:06/03/2021

Experiment No. 2

1. Aim/Overview of the practical:

USE THE PERMUTATION AND COMBINATION FUNCTIONS

Task to be done:

1. Experiment No. 2:

1. Algorithm
STEP1: Import the package of Permutation

STEP2: List to be entered from the user

STEP3: Enter the permutation function

STEP4: Run the for loop for p in list (permutation function)

STEP5: Print p

STEP6: Import the package of Combinations

STEP7: List to be entered from the user

STEP8: Enter the combinations function

STEP9: Run the for loop for c in list (combinations function)

STEP10: Print c
2. Code for experiment/practical:
from itertools import permutations

list1=input("enter the list1\n")
per = permutations(list1)

for p in list(per):
   print(p)

from itertools import combinations

list2=input("enter the list2\n")
combi= combinations(list2,1)

for c in list(combi):
    print(c)

3. Result/Output/Writing Summary:

Learning outcomes (What I have learnt):

1.
2.

Evaluation Grid:

Sr. No. Parameters Marks Obtained Maximum Marks


1. Demonstration and Performance 5
(Pre Lab Quiz)
2. Worksheet 10
3. Post Lab Quiz 5

You might also like