0% found this document useful (0 votes)
9 views4 pages

python_03

The document contains a series of Python code snippets for basic mathematical operations, including currency conversion from USD to Indian Rupees, data size conversions from bits to larger units, calculating square roots, area of rectangles and squares, and surface area of cylinders. It also includes a simple program for swapping two numbers. Each code snippet prompts the user for input and prints the calculated results.

Uploaded by

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

python_03

The document contains a series of Python code snippets for basic mathematical operations, including currency conversion from USD to Indian Rupees, data size conversions from bits to larger units, calculating square roots, area of rectangles and squares, and surface area of cylinders. It also includes a simple program for swapping two numbers. Each code snippet prompts the user for input and prints the calculated results.

Uploaded by

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

Practical 3

1.
usdollar =int(input("Enter Dallar Amount"))
Indrup = usdollar*83
print("Indian Rupee",Indrup)

output:

2. bits =int(input("Enter Number In Bits"))


byts =bits/8
kb = byts/1024
mb = kb/1024
gb = mb/1024
tb = gb/1024
print("MEGABITES",mb)
print("GIGABITES",gb)
print("TERABITES",tb)

3.
a =int(input("Enter a Number"))
sq=a**0.5
print("square Root Of Number Is",sq)

output :

4.
Length =int(input("Enter the Length"))
Breadth =int(input("Enter the Breadth"))
Area=Length*Breadth
print(Area)

output :

5.
s =int(input("Enter the side="))
print("area of square is =",s*s)
print("perimeter of square is ="(4*s))

output:

6.
r =int(input("Enter Radius=="))
h=int(input("Enter Height"))
sv =3.14*r*r*h
ac=2*3.14*r*(r+h)
print("surface area ",sv)
print("Area of cylinder ",ac)

output :

no1 = int(input("Enter 1 st no"))


no2 = int(input("Enter the 2 nd no"))
print("no1",no1)
print("no2",no2)
tem =no1
no1 = no2
no2 = tem
print("after the swapping ")
print("no1",no1)
print("no2",no2)

You might also like