Home > Backend Development > Python Tutorial > Python - Level : asks

Python - Level : asks

Linda Hamilton
Release: 2024-12-03 21:29:10
Original
191 people have browsed it

Python - Level : asks

Level 1 Tasks

1) Fahrenheit to Celcius Conversion

f=int(input("Enter the no. "))

c=5/9*(f-32)

print("Fahrenheit to celsius",round(c))
Copy after login

Output:

Enter the no. 108
Fahrenheit to celsius 42

Copy after login

2) Celcius to Fahrenheit Conversion

c=int(input("Enter the no. "))
f=c*(9/5)+32

print("celsius to fahrenheit",round(f))
Copy after login

Output:

Enter the no. 42
celsius to fahrenheit 108

Copy after login

3) Ft to Meter Conversion

#1 Feet = 0.3048 meters

feet=float(input("Enter the no. "))

meter=feet*0.3048

print("feet to meters",round(meter,1))
Copy after login

Output:

Enter the no. 15
feet to meters 4.6

Copy after login

4) Input-Side,Output-Area of A Square

side=float(input("Enter the no. "))

area=side**2

print("Area of a square is ",area)
Copy after login

Output:

Enter the no. 5
Area of a square is  25.0

Copy after login

5) Input-Length, Breadth;Output- Area of a Rectangle

#Area of a Rectangle=length*breadth

length=float(input("Enter length of the rectangle. "))
breadth=float(input("Enter breadth of the rectangle. "))

area=length*breadth

print("Area of a rectangle is ",area)
Copy after login

Output:

Enter length of the rectangle. 5
Enter breadth of the rectangle. 10
Area of a rectangle is  50.0

Copy after login

6) Radius - Area of a circle

#Area of circle = πr2

r=int(input("Enter the radius of circle: "))

area=3.14*(r**2)

print("Area of the circle is ",area)
Copy after login

Output:

Enter the radius of circle: 5
Area of the circle is  78.5

Copy after login

7) USD to INR Conversion

#usd=Rs. 84.56

dollar=float(input("Enter currency in dollars: "))
usd=dollar*84.56

print("Currency in rupees is =",usd)
Copy after login

Output:

Enter currency in dollars: 500
Currency in rupees is = 42280.0

Copy after login

The above is the detailed content of Python - Level : asks. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template