Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Python program to prompt the user to enter the temperature in Fahrenheit

ID: 3579166 • Letter: W

Question

Write a Python program to prompt the user to enter the temperature in Fahrenheit. Convert the entered value in Celsius and print the result. Write a Python program to prompt the user to enter an integer. Store this value as x. Print the values of: 2x, x^2, x^3, x^10, x, x! (where, x! is the factorial of x). In Geometry: Given a triangle ABC, the sum of two sides of any two sides of a triangle is greater than the third side. Write a Python program to prompt the user to enter the lengths of three sides: a, b, and c. Print if these three lengths can form a triangle or not: Following is a sample output. Enter a: 8 Enter b: 9 Enter c: 23 8, 9, and 23 cannot form a triangle Enter a: 3 Enter b: 4 Enter c: 5 3, 4, and 5 can form a triangle

Explanation / Answer

1.

f = input('Enter the temperature in fahrenheit: ')
c = (f - 32.0) / 1.8
print 'The celsius temperature is ' + str(c)

2.

import math
x = input('Enter the value of x: ')
print '2x = ' + str(2 * x)
print 'x^2 = ' + str(x ** 2)
print 'x^3 = ' + str(x ** 3)
print 'x^10 = ' + str(x ** 10)
print 'x = ' + str(x)
print 'x! = ' + str(math.factorial(x))

3.

a = input('Enter a: ')
b = input('Enter b: ')
c = input('Enter c: ')
if a + b > c and b + c > a and a + c > b:
   print str(a) + ', ' + str(b) + ' and ' + str(c) + ' can form a triangle'
else:
   print str(a) + ', ' + str(b) + ' and ' + str(c) + ' can not form a triangle'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote