SlideShare a Scribd company logo
1 of 1
Download to read offline
In python Write a program TempConverter.py that converts temperature from Celsius to
Fahrenheit an from Fahrenheit to Celsius depending on the user input. Display a menu to the user
to select an option (1 for C to F and 2 for F to CD Additional information a) Use input function
to receive user input b) Use floating point number for Celsius and Fahrenheit c) Output should
display only two decimal values. So, use format specifier %.2f Welcome to Temperature
Conversion Program 1) Convert from Fahrenheit to Celsius 2) Convert from Celsius to
Fahrenheit Enter your choice: 1 Enter temperature: 68.3 Expected output You selected option 1
68.30 degrees Fahrenheit is equal to 20.17 degrees Celsius Welcome to Temperature Conversion
Program 1) Convert from Fahrenheit to Celsius 2) Convert from Celsius to Fahrenheit Enter your
choice: 2 Enter temperature: -12.80 Expected output You selected option 2 12.80 degrees Celsius
is equal to 8.96 degrees Fahrenheit
Solution
#converstion of temprature
print('Welcome to Temprature Conversion program')
print('1)convert from Farenhiet to Celcious ')
print('2) convert from Celcious to Farenhiet')
n=input("Please Enter 1or 2")
if n==1:
Farenhiet=input("Please input celcious")
celcious=(5.0/9.0)*(Farenhiet-32)
print('%0.2f degree Farenhiet is equal to %0.2f degree Celcious' %(celcious))
elseif n==2:
celcious=input("Enter the celcious")
Farenhiet=(9.0/5.0)*(celcious+32)
print('%0.2f degree Celcious is equal to %0.2f degree Farenhiet' %(Farenhiet))
else:
print('the Number is not input in correct format')

More Related Content

Similar to In python Write a program TempConverter.py that converts temperature.pdf

Humidity and Temperature Measurement Using Arduino
Humidity and Temperature Measurement Using ArduinoHumidity and Temperature Measurement Using Arduino
Humidity and Temperature Measurement Using Arduinodollonhaider
 
Modules and Scripts- Python Assignment Help
Modules and Scripts- Python Assignment HelpModules and Scripts- Python Assignment Help
Modules and Scripts- Python Assignment HelpAnderson Silva
 
C++ Overview
C++ OverviewC++ Overview
C++ Overviewkelleyc3
 
QuecPython_Weather_Station_Demo_Tutorial.pdf
QuecPython_Weather_Station_Demo_Tutorial.pdfQuecPython_Weather_Station_Demo_Tutorial.pdf
QuecPython_Weather_Station_Demo_Tutorial.pdfJohnEerl
 
2nd day System Configuration & Basic Functions Control Functions Design Tools...
2nd day System Configuration & Basic Functions Control Functions Design Tools...2nd day System Configuration & Basic Functions Control Functions Design Tools...
2nd day System Configuration & Basic Functions Control Functions Design Tools...ssuserd973fe
 
Cn mx3000 p_20120808e
Cn mx3000 p_20120808eCn mx3000 p_20120808e
Cn mx3000 p_20120808eElsa von Licy
 

Similar to In python Write a program TempConverter.py that converts temperature.pdf (8)

Pf70 700 process_pi
Pf70 700 process_piPf70 700 process_pi
Pf70 700 process_pi
 
Apclass (2)
Apclass (2)Apclass (2)
Apclass (2)
 
Humidity and Temperature Measurement Using Arduino
Humidity and Temperature Measurement Using ArduinoHumidity and Temperature Measurement Using Arduino
Humidity and Temperature Measurement Using Arduino
 
Modules and Scripts- Python Assignment Help
Modules and Scripts- Python Assignment HelpModules and Scripts- Python Assignment Help
Modules and Scripts- Python Assignment Help
 
C++ Overview
C++ OverviewC++ Overview
C++ Overview
 
QuecPython_Weather_Station_Demo_Tutorial.pdf
QuecPython_Weather_Station_Demo_Tutorial.pdfQuecPython_Weather_Station_Demo_Tutorial.pdf
QuecPython_Weather_Station_Demo_Tutorial.pdf
 
2nd day System Configuration & Basic Functions Control Functions Design Tools...
2nd day System Configuration & Basic Functions Control Functions Design Tools...2nd day System Configuration & Basic Functions Control Functions Design Tools...
2nd day System Configuration & Basic Functions Control Functions Design Tools...
 
Cn mx3000 p_20120808e
Cn mx3000 p_20120808eCn mx3000 p_20120808e
Cn mx3000 p_20120808e
 

More from SALES97

Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdfBlossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdfSALES97
 
A system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdfA system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdfSALES97
 
Write an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdfWrite an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdfSALES97
 
Why is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdfWhy is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdfSALES97
 
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdfWhy are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdfSALES97
 
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdfWhen acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdfSALES97
 
Which of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdfWhich of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdfSALES97
 
What Michael acceptor is needed for the conjugate addition Beta - .pdf
What Michael acceptor is needed for the conjugate addition  Beta - .pdfWhat Michael acceptor is needed for the conjugate addition  Beta - .pdf
What Michael acceptor is needed for the conjugate addition Beta - .pdfSALES97
 
What is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdfWhat is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdfSALES97
 
What is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdfWhat is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdfSALES97
 
What happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdfWhat happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdfSALES97
 
TrueFalse A virtual private network is a way to use the Internet to.pdf
TrueFalse  A virtual private network is a way to use the Internet to.pdfTrueFalse  A virtual private network is a way to use the Internet to.pdf
TrueFalse A virtual private network is a way to use the Internet to.pdfSALES97
 
The total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdfThe total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdfSALES97
 
The problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdfThe problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdfSALES97
 
The probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdfThe probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdfSALES97
 
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdfThe Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdfSALES97
 
The IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdfThe IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdfSALES97
 
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdfTable 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdfSALES97
 
State if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdfState if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdfSALES97
 
subject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdfsubject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdfSALES97
 

More from SALES97 (20)

Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdfBlossom Corporation had 120,000 common shares outstanding on Decembe.pdf
Blossom Corporation had 120,000 common shares outstanding on Decembe.pdf
 
A system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdfA system experiences a phase change from liquid to solid. Is this exo.pdf
A system experiences a phase change from liquid to solid. Is this exo.pdf
 
Write an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdfWrite an equation of a tangent function with the following characters.pdf
Write an equation of a tangent function with the following characters.pdf
 
Why is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdfWhy is a mixture of alcohol and water used, rather than simply water.pdf
Why is a mixture of alcohol and water used, rather than simply water.pdf
 
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdfWhy are the 1960s relatively turbulentSolutionAnswer1960s .pdf
Why are the 1960s relatively turbulentSolutionAnswer1960s .pdf
 
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdfWhen acting as a neurotransmitter NO binds to the iron atom in vario.pdf
When acting as a neurotransmitter NO binds to the iron atom in vario.pdf
 
Which of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdfWhich of the following are reasons that Drosophila are an ideal exper.pdf
Which of the following are reasons that Drosophila are an ideal exper.pdf
 
What Michael acceptor is needed for the conjugate addition Beta - .pdf
What Michael acceptor is needed for the conjugate addition  Beta - .pdfWhat Michael acceptor is needed for the conjugate addition  Beta - .pdf
What Michael acceptor is needed for the conjugate addition Beta - .pdf
 
What is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdfWhat is the role of intuition in decision-makingSolutionIntui.pdf
What is the role of intuition in decision-makingSolutionIntui.pdf
 
What is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdfWhat is the difference between a HTML element’s id attribute and nam.pdf
What is the difference between a HTML element’s id attribute and nam.pdf
 
What happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdfWhat happens when youre Running Scripts without a console in Linux.pdf
What happens when youre Running Scripts without a console in Linux.pdf
 
TrueFalse A virtual private network is a way to use the Internet to.pdf
TrueFalse  A virtual private network is a way to use the Internet to.pdfTrueFalse  A virtual private network is a way to use the Internet to.pdf
TrueFalse A virtual private network is a way to use the Internet to.pdf
 
The total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdfThe total physical units accounted for is the sum of the units co.pdf
The total physical units accounted for is the sum of the units co.pdf
 
The problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdfThe problem can be found below. I would like someone to run this. I .pdf
The problem can be found below. I would like someone to run this. I .pdf
 
The probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdfThe probability that a teacher will give an unannounced test duri.pdf
The probability that a teacher will give an unannounced test duri.pdf
 
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdfThe Orlando MedicalOrlando Medical Corporation financial statements.pdf
The Orlando MedicalOrlando Medical Corporation financial statements.pdf
 
The IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdfThe IP network is a virtual network and must rely on a link layer ne.pdf
The IP network is a virtual network and must rely on a link layer ne.pdf
 
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdfTable 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
Table 1 Endowment of Labor and Capital US 100 20 Canada 10 Workers Ma.pdf
 
State if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdfState if you agree or disagree with the statement made and whyLes.pdf
State if you agree or disagree with the statement made and whyLes.pdf
 
subject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdfsubject.....project management.Tools and Processes Based on the pr.pdf
subject.....project management.Tools and Processes Based on the pr.pdf
 

Recently uploaded

Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

In python Write a program TempConverter.py that converts temperature.pdf

  • 1. In python Write a program TempConverter.py that converts temperature from Celsius to Fahrenheit an from Fahrenheit to Celsius depending on the user input. Display a menu to the user to select an option (1 for C to F and 2 for F to CD Additional information a) Use input function to receive user input b) Use floating point number for Celsius and Fahrenheit c) Output should display only two decimal values. So, use format specifier %.2f Welcome to Temperature Conversion Program 1) Convert from Fahrenheit to Celsius 2) Convert from Celsius to Fahrenheit Enter your choice: 1 Enter temperature: 68.3 Expected output You selected option 1 68.30 degrees Fahrenheit is equal to 20.17 degrees Celsius Welcome to Temperature Conversion Program 1) Convert from Fahrenheit to Celsius 2) Convert from Celsius to Fahrenheit Enter your choice: 2 Enter temperature: -12.80 Expected output You selected option 2 12.80 degrees Celsius is equal to 8.96 degrees Fahrenheit Solution #converstion of temprature print('Welcome to Temprature Conversion program') print('1)convert from Farenhiet to Celcious ') print('2) convert from Celcious to Farenhiet') n=input("Please Enter 1or 2") if n==1: Farenhiet=input("Please input celcious") celcious=(5.0/9.0)*(Farenhiet-32) print('%0.2f degree Farenhiet is equal to %0.2f degree Celcious' %(celcious)) elseif n==2: celcious=input("Enter the celcious") Farenhiet=(9.0/5.0)*(celcious+32) print('%0.2f degree Celcious is equal to %0.2f degree Farenhiet' %(Farenhiet)) else: print('the Number is not input in correct format')