subject

CSCD 110

# This program uses value functions to do some conversions.
# Define our constant variables
# These are our menu options
F_TO_C = 1
C_TO_F = 2
F_TO_M = 3
M_TO_F = 4
EXTRA = 5
QUIT = 0
# We need a main function
def main():
choice = 7
while choice != QUIT:
display_menu() # Call to display our menu
choice = int(input("Please enter a menu choice: "))
if choice == F_TO_C:
temp = float(input("Please enter a temperature in degrees Fahrenheit."))
print(temp, "degrees Fahrenheit is equal to ", convert_to_celcius(temp),"degrees Celcius")

def convert_to_celcius(fahrenheit):
return (fahrenheit - 32) * 5/9
def display_menu():
print(" Menu")
print("1. Convert from Fahrenheit to Celsius.")
print("2. Convert from Celsius to Fahrenheit.")
print("3. Convert Feet to Meters.")
print("4. Convert Meters to Feet.")
print("5. Print a string backwards.")
print("0. Quit.")

Why does my menu function not display in the python shell? Plz Help.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Someone wishes to run the software on another computer system that runs an operating system that does not support the software what can he do
Answers: 3
question
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
You know the right answer?
CSCD 110

# This program uses value functions to do some conversions.
# Define our...
Questions
question
Mathematics, 18.01.2020 09:31
question
Mathematics, 18.01.2020 09:31
Questions on the website: 13722367