0% found this document useful (0 votes)
5 views

LAB PGM1

The document outlines a Python lab exercise focused on converting temperatures between Fahrenheit and Celsius. It includes the aim, algorithm, coding example, and a flowchart illustrating the process. The exercise is designed for students in the Department of Computer Science at K.C.S.Kasi Nadar College of Arts & Science.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

LAB PGM1

The document outlines a Python lab exercise focused on converting temperatures between Fahrenheit and Celsius. It includes the aim, algorithm, coding example, and a flowchart illustrating the process. The exercise is designed for students in the Department of Computer Science at K.C.S.Kasi Nadar College of Arts & Science.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

K.C.S.

KASI NADAR COLLEGE OF ARTS & SCIENCE


(Belongs to S.V.H.N.A.Dharma Fund)

PYTHON LAB EXERCISE : 1

By,
Mrs.R.DEVIPRIYA,
Assistant Professor,
Department Of Computer Science.
INDEX PAGE
NAME : SUBJECT NAME : PROBLEM SOLVING
USING PYTHON
CLASS : SUB.CODE :
S.NO DATE PROGRAM NAME WRITTEN OUTPUT RECORD
FLOW CHART - SYMBOLS
LAB EXERCISE - I
Program to convert the given
temperature from Fahrenheit to
Celsius and vice versa depending
upon user’s choice.
FORMULA
• Conversion from Fahrenheit to Celsius
C = ( F – 32 ) * 5 / 9

• Conversion from Celsius to Fahrenheit


F = ( C * 9 / 5 ) + 32
AIM

 To convert the given temperature from


Fahrenheit to Celsius and Celsius to Fahrenheit.
ALGORITHM
 Step 1 : Start
 Step 2 : Read the value of F.
 Step 3 : Compute the value of temperature in Celsius.
C = ( F - 32 ) * 5/9
 Step 4 : Write the value of C
 Step 5 : Read the value of temperature in Celsius, C
 Step 6 : Compute the value of temperature in Fahrenheit
F = ( 9 / 5 * C ) + 32
 Step 7 : Write the value of temperature in Fahrenheit , F
 Step 8 : Stop
CODING
#python program to convert celsius to fahrenheit and vice versa
f=int(input("Enter the temperature in Fahrenheit : "))
c=(f-32)*5/9
print(f," in Fahrenheit = ", c , "in Celsius")
c=int(input("Enter temperature in Celsius : "))
f=(9/5*c)+32
print(c, " in Celsius = ", f , " in Fahrenheit")
FLOW CHART : START

Enter the
Enter the temperature in
temperature in Celsius
Fahrenheit

C = ( 9/5 * C ) + 32
C = ( F – 32 ) * 5/9

Write
Write
Temperature in
“Temperature
Fahrenheit”, f
in Celsius”, c

STOP
RESULT
• Thus, the given program was executed and the output was
displayed in the python shell.

You might also like