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 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
You know the right answer?
CSCD 110

# This program uses value functions to do some conversions.
# Define our...
Questions
question
Mathematics, 18.08.2019 08:20
question
English, 18.08.2019 08:20