Professional Documents
Culture Documents
Ans:
Lists are one of the four built-in data structures in Python, together with tuples, dictionaries,
and sets. They are used to store an ordered collection of items, which might be of different
types. Commas separate the elements that are contained within a list and enclosed in square
brackets.
Ans:
Unlike strings, lists are mutable. This means we can change an item in a list by accessing it
directly as part of the assignment statement. Using the indexing operator (square brackets) on
the left side of an assignment, we can update one of the list items. ... Item assignment does not
work for strings.
Practical No. 6
Output:
>>> %Run exp6_1.py
sum= 150
Output:
>>> %Run exp6_2.py
Multiple product of all list items= 120
Output:
>>> %Run exp6_3.py
Largest Number is: 50
Practical No. 6
Output:
>>> %Run exp6_4.py
Smallest Number is: 10
Output:
>>> %Run exp6_5.py
Original list is: [10, 20, 30, 40, 50]
Reverse of list is: [50, 40, 30, 20, 10]
Output:
>>> %Run exp6_6.py
33 is common
22 is common
Practical No. 6
Output:
>>> %Run exp6_7.py
Even Items are:
22
46
88
90
100