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, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
question
Computers and Technology, 24.06.2019 09:10
  to change the number of rows and columns displayed by the excel object a. select the object and drag a size handle on the active object. b. deselect the object and drag a size handle of the object. c. deselect the object and drag a row or column divider of the object. d. select the object and drag a row or column divider on the active object.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
Answers: 1
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her age and assigns the user’s input to an integer variable named age.
Answers: 1
You know the right answer?
CSCD 110

# This program uses value functions to do some conversions.
# Define our...
Questions
question
Mathematics, 02.11.2020 21:10
question
Health, 02.11.2020 21:10
Questions on the website: 13722365