Python Program to Create a Fahrenheit to Celsius Table

Fahrenheit to Celsius Conversion Table in Python

Input Format :
3 integers - S, E and W respectively 

Output Format :
Fahrenheit to Celsius conversion table. One line for every Fahrenheit and corresponding Celsius value. The Fahrenheit value and its corresponding Celsius value should be separate by single space.
Sample Input :
0 
40 
5
Sample Output :
0	-17
5	-15
10	-12
15	-9
20	-6
25	-3
30	-1
35	1
40	4

Solution :

  1. S = int(input())
  2. E = int(input())
  3. W = int(input())

  4. Flag = S
  5. while Flag <= E:
  6. s = int((Flag - 32) * (5/9))
  7. print(str(Flag)+ "\t"+str(s))
  8. Flag = Flag + W

Previous Post Next Post