0% found this document useful (0 votes)
24 views3 pages

PWP Exp3

The document contains examples of Python code to perform basic calculations and data conversions including converting between currencies, units of data storage, calculating areas and volumes of geometric shapes, and swapping variable values.

Uploaded by

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

PWP Exp3

The document contains examples of Python code to perform basic calculations and data conversions including converting between currencies, units of data storage, calculating areas and volumes of geometric shapes, and swapping variable values.

Uploaded by

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

Exp3_st1_05

usd = float(input("Enter amount in USD : "))


inr = usd*83.11
print("The amount in Indian Rupee is :", inr)

Exp3_st2_05

bits = float(input("Enter bits to convert:"))


byte=bits/8
kb=byte/1024
mb=kb/1024
gb=mb/1024
tb=gb/1024
print(bits,"bits = ",byte,"bytes")
print(byte,"bytes = ",kb,"kilo bytes")
print(kb,"kilo bytes = ",mb,"mega bytes")
print(mb,"mega bytes = ",gb,"giga bytes")
print(gb,"giga bytes = ",tb,"tera bytes")
Exp3_st3_05

num=float(input("Enter a number to find square root:"))


sqrt=num**0.5
print("Square root of ",num,"=",sqrt)

Exp3_st4_05

l=float(input("Enter length of Rectangle:"))


b=float(input("Enter breadth of Rectangle:"))
print("Area of Rectangle=",l*b)

Exp3_st5_05

side=float(input("Enter side of square:"))


print("Area of square=",side*side)
print("Perimeter of square=",side*4)
Exp3_st6_05

# area of cylinder = 2 · π · r · (r + h)
# volume of cylinder = π · r2 · h
import math
radius = float(input("Enter radius of Cylinder : "))
height = float(input("Enter height of Cylinder : "))
print("The Area of Cylinder is : ",2 * math.pi * radius *
(radius + height),"Sq.units")
print("The volume of Cylinder is :", math.pi * radius ** 2 *
height)

Exp3_st7_05

num1=int(input("Enter first numbers:"))


num2=int(input("Enter second numbers:"))
temp = num1
num1 = num2
num2 = temp
print("Numbers after swapping= num1:",num1,"num2:",num2)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy