Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PRACTICAL NO.

Name: Pranav Sandip Wadge.

Roll_No:03.

Branch: TYCO.

--------------------------------------------------

X1. print(f"The list after multiplying each


number by 2 is:= {multiplied_numbers}")
1]
Output:
mylist = {'l': 9, 's': 30, 'p': 10}
=============== RESTART: C:\Users\
total = sum(mylist.values())
Admin\Desktop\pranav\mullist.py
print(total) ===============

Output: The list after multiplying each number by


2 is:= [81, 90, 270, 270]
=============== RESTART: C:\Users\
Admin\Desktop\pranav\sumitem.py --------------------------------------------------
===============
3]
49
numbers = [12, 45, 78, 23, 56, 799, 34]
--------------------------------------------------

if not numbers:
2]
print("The list is empty.")
numbers = [9,10,30,30]
else:

largest = numbers[0]
if not numbers:

print("The list is empty.")


fornum in numbers[1:]:
else:
ifnum> largest:
multiplied_numbers = [num * 9 for num in
largest = num
numbers]

print(f"The largest number in the list is:=


{largest}")
PRACTICAL NO.6

Output:

============== RESTART: C:\Users\


Admin\Desktop\pranav\largrelist.py
=============

The largest number in the list is:= 799

--------------------------------------------------

4]

numbers = [2, 50, 57, 28, 31, 7, 45]

if not numbers:

print("The list is empty.")

else:

smallest = numbers[0]

fornum in numbers[1:]:

ifnum< smallest:

smallest = num

print(f"The smallest number in the list is:=


{smallest}")

Output:

============== RESTART: C:\Users\


Admin\Desktop\pranav\smalllist.py
==============

The smallest number in the list is:= 2

**********************

You might also like