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

Combined Python Answers

The document contains five Python programs: one for converting Celsius to Fahrenheit, another for calculating the circumference and area of a circle, a third for converting kilometers to miles, a fourth for summing two integers, and a fifth for calculating the area and perimeter of a rectangle. Each program prompts the user for input and prints the corresponding output. The programs demonstrate basic mathematical operations and user interaction in Python.

Uploaded by

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

Combined Python Answers

The document contains five Python programs: one for converting Celsius to Fahrenheit, another for calculating the circumference and area of a circle, a third for converting kilometers to miles, a fourth for summing two integers, and a fifth for calculating the area and perimeter of a rectangle. Each program prompts the user for input and prints the corresponding output. The programs demonstrate basic mathematical operations and user interaction in Python.

Uploaded by

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

# Program 1: Convert Celsius to Fahrenheit

celsius = float(input("Enter temperature in Celsius: "))


fahrenheit = (celsius * 1.8) + 32
print("Temperature in Fahrenheit:", fahrenheit)

# Program 2: Calculate Circumference and Area of a Circle


radius = float(input("Enter the radius of the circle: "))
pi = 3.14
circumference = 2 * pi * radius
area_circle = pi * radius * radius
print("Circumference of the circle:", circumference)
print("Area of the circle:", area_circle)

# Program 3: Convert Kilometers to Miles


km = float(input("\nEnter distance in kilometers: "))
miles = km * 0.621371
print("Distance in miles:", miles)

# Program 4: Sum of Two Integers


a = int(input("\nEnter the first number: "))
b = int(input("Enter the second number: "))
sum_two = a + b
print("The sum is:", sum_two)

# Program 5: Area and Perimeter of a Rectangle


length = eval(input("\nEnter the length of the rectangle: "))
breadth = eval(input("Enter the breadth of the rectangle: "))
area_rect = length * breadth
perimeter = 2 * (length + breadth)
print("Area of the rectangle:", area_rect)
print("Perimeter of the rectangle:", perimeter)

You might also like