Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, bstine6678
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
image
Computers and Technology, 23.06.2019 22:00, rocksquad9125
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
image
Computers and Technology, 23.06.2019 22:40, azariah7
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
image
Computers and Technology, 24.06.2019 02:10, trint5952
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
Do you know the correct answer?
CSCD 110

# This program uses value functions to do some conversions.
# Define our...

Questions in other subjects: