Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6694151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:04:07+00:00 2026-05-26T06:04:07+00:00

Ive been working on this tempeture converter but have been troubling conbining the two

  • 0

Ive been working on this tempeture converter but have been troubling conbining the two programs (Celsius to Fahrenheit) and (Fahrenheit to Celsius), i can get the display menu to print but cant manage to figure out how to select a converter.

# Tempeture Converter
def convert():
    print 'Conversions Menu';
    print '(1) Celsius to Fahrenheit';
    print '(2) Fahrenheit to Celsius';

def select():
    convert();
    choice = input ('Enter Choice Number:')
    if (input == '1'):
        C2F();
    elif (input == '2'):
        F2C();

def F2C():
    Fahrenheit = input('enter degrees in Fahrenheit: ');
    Celsius    = ( 5.0 / 9.0) * (Fahrenheit -32); 
    print Fahrenheit, 'Fahrenheit =', Celsius, 'Celsius';

def C2F():
    Celsius    = input('enter degrees in Celsius: ');
    Fahrenheit = (9.0 / 5.0) * Celsius +32;
    print Celsius, 'Celsius =', Fahrenheit, 'Fahrenheit';

*Correction*

# Tempeture Converter
def convert():
    print 'Conversions Menu';
    print '(1) Celsius to Fahrenheit';
    print '(2) Fahrenheit to Celsius';

def select():
    convert();
    choice = input ('Enter Choice Number:')
    if (choice == '1'):
        C2F();
    elif (choice == '2'):
        F2C();

def F2C():
    Fahrenheit = input('enter degrees in Fahrenheit: ');
    Celsius    = ( 5.0 / 9.0) * (Fahrenheit -32); 
    print Fahrenheit, 'Fahrenheit =', Celsius, 'Celsius';

def C2F():
    Celsius    = input('enter degrees in Celsius: ');
    Fahrenheit = (9.0 / 5.0) * Celsius +32;
    print Celsius, 'Celsius =', Fahrenheit, 'Fahrenheit';
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:04:08+00:00Added an answer on May 26, 2026 at 6:04 am

    You should be using raw_input instead of input, input will try to wrap whatever you type in eval to convert it to Python code, so when you enter ‘1’ or ‘2’ it will be converted to an integer, but you are still trying to compare to strings.

    Combine that with what Paul mentioned about choice instead of input and you should have a working solution.

    Also, drop all of the semi-colons and the parentheses in your conditionals, they aren’t necessary in Python:

    def select():
        convert()
        choice = raw_input('Enter Choice Number:')
        if choice == '1':
            C2F()
        elif choice == '2':
            F2C()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working at this for two days and have not had much luck.
On this page Ive been working on forever , I have this column headed
Ive been working at this problem for about a week, I have looked up
I've been working on this for a couple of hours and can't seem to
I've been working on this project for about two weeks now. I don't understand
I've been working on this for a long time now and can't figure out
I've been working on this problem for a few hours and have used many
Ive been working with Python and C++ together for some time, but never tried
I've been working on this site for the past two weeks and everything has
been having trouble with this script, ive managed to get it working in ie8,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.