Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views2 pages

Assignment1 Variables, Operators

Uploaded by

shitendu.some
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)
3 views2 pages

Assignment1 Variables, Operators

Uploaded by

shitendu.some
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/ 2

Problem solving using Python Programming

I BTech I sem
UNIT – I
Topics: Variables / operators / data types

Python Programs

1. A. Gym Membership: Create a program that calculates the cost of a year-long gym
membership if it costs $30 per month.
Output: Yearly cost of the gym membership: $ 360
B. Travel Distance: Create a program that calculates the distance travelled by a car that
drove at a speed of 60 miles per hour for 2.5 hours.
Output: Distance travelled by the car: 150.0 miles
2. A. Currency converter: Develop a currency converter. Implement a feature that converts
an amount in US Dollars to Indian Rupee using a conversion rate (82.52)
Output
Enter the amount in US Dollars: 36
Amount in Indian Rupees: 2970.72
B. Baking Cookies: Create a program that calculates how much sugar is needed to make
3 batches of cookies when each batch requires 2 cups of sugar.
Output: Total amount of sugar needed for 3 batches of cookies: 6 cups
3. A. Age Difference: Create a program that calculates the age difference between Joseph
and Arnav. Joseph's birth year is 1990 and Arnav's birth year is 1985. Calculate their
individual ages and display the age difference.
Output:
Age of the Joseph : 34 years
Age of the Arnav : 39 years
Age difference between the two people: 5 years

B. Cinema Tickets: Create a program that calculates the total cost of buying cinema
tickets for a group of 3 adults and 4 children. The adult tickets cost $10 each, and the
child tickets cost $5 each.
Output: Total cost of tickets: $ 50
4. A. BMI Calculator: Create a program that calculates the Body Mass Index (BMI) of a
person. Given the weight (in kilograms) is 70 and the height (in meters) is 1.75, calculate
and display their BMI.

Output: Your BMI is: 22.857142857142858


B. Simple Interest Calculator: Create a Python program that calculates simple interest
for a given principal amount, interest rate, and time period?"

5. A. Write a program that calculate the area, perimeter, and diagonal of a rectangle, where
length and breadth are the sides of the rectangle, where Length is 5m and Breadth is 3m

Output:
The area of the rectangle is 15 square meters.
The perimeter of the rectangle is 16 meters.
The diagonal of the rectangle is 5.83 meters.
B. Write a program that calculate area and circumference of a circle, given radius(r) is 5cm

Output:
The area of the circle is 78.54 square centimeters.
The circumference of the circle is 31.42 centimeters.
C. Write a program that calculates the area and perimeter of a triangle with sides
s1=15cm, s2=10cm, s3=8cm

Output :
The perimeter of the triangle is 33 cm.
The area of the triangle is 58.00 square centimeters.

You might also like