# -*- coding: utf-8 -*-"""Created on Tue Feb 21 15:20:48 2017@author: admin"""# 2.1(Convert Celsius to Fahrenheit)celsius = eval(input("Enter a degree in Celsiur: "))fahrenheit = (9 / 5) * celsius + 32PRint(celsius, "Celsius is ", fahrenheit, "Fahrenheit")# 2.2(Compute the volume of a cylinder)radius, length = eval(input("Enter the radius and length of a cylinder: "))PI = 3.14159area = radius * radius * PIvolume = area * lengthprint("The area is ", round(area * 10000) / 10000 )print("The volume is ", round(volume * 10) / 10 )# 2.3(Convert feet into meters)feet = eval(input("Enter a value for feet: "))meters = feet * 0.305print(feet, " feet is ", meters, "meters")# 2.4(Convert pounds into kilograms)pounds = eval(input("Enter a value in pounds:"))kilograms = pounds * 0.454print(pounds, " pounds is ", kilograms, "kilograms")# 2.5(Financial application: calculate tips)subtotal, gratuityRate = eval(input("Enter the subtotal and a gratuity rate: "))gratuity = subtotal * gratuityRate / 100print("The gratuity is ", gratuity, " and the total is ", subtotal + gratuity) # 2.6(Sum the digits in an integer)inputNumber = eval(input("Enter a number between 0 and 1000:"))unitsDigitOfInputNumber = inputNumber % 10remainingNumber = inputNumber // 10tensDigitOfInputNumber = remainingNumber % 10hundredDigitOfInputNumber = remainingNumber // 10sumTheDigits = unitsDigitOfInputNumber + tensDigitOfInputNumber + hundredDigitOfInputNumberprint("The sum of the digits is ", sumTheDigits)# 2.7(Find a number of years and days)minutes = eval(input("Enter the number of minutes: "))days = int(minutes / 60 / 24) years = int(days // 365)remainingdays = int(days % 365)print(minutes, " minutes is approximately", years, "years and", remainingdays, "days") # 2.8()