0% found this document useful (0 votes)
24 views1 page

PWP PR 7

The document presents practical coding exercises completed by Qazi Arqam Arif, focusing on finding the minimum and maximum values in a tuple, identifying common elements in a tuple, and converting numbers into words. The outputs demonstrate the results of each code snippet, showcasing the functionality of Python in handling tuples and dictionaries. Overall, it illustrates basic programming concepts and operations in Python.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

PWP PR 7

The document presents practical coding exercises completed by Qazi Arqam Arif, focusing on finding the minimum and maximum values in a tuple, identifying common elements in a tuple, and converting numbers into words. The outputs demonstrate the results of each code snippet, showcasing the functionality of Python in handling tuples and dictionaries. Overall, it illustrates basic programming concepts and operations in Python.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical No.

7
#Name: Qazi Arqam Arif
#Enrollment: 2205690362
#Batch: 2

Code:
# Minimum and maximum
T1 = (9,8,7,6,5,2)
print("Maximum no: ", max(T1))
print("Minimum no: ",min(T1))

Output:
Maximum no: 9
Minimum no: 2

Code:
#common elements
T1 = (1, 2, 3, 1, 2, 4, 5)
L = []
for e in T1:
if T1.count(e) > 1 and e not in L:
L.append(e)
print(L)

Output:
[1, 2]

Code:
# Numbers in words
number = tuple('2039')
dic = {'0': 'zero', '1': 'one', '2': 'Two', '3': 'Three', '4':'Four','5':'Five','6':'Six','7':'Seven','8':'Eight', '9':'Nine'}
r = ""
for i in number:
r = r + dic[i] + " "
print(r)

Output:
Two One Three Nine

You might also like