Question

Please Help with the code below not sure where my error is...Thanks. Program output displayed here:...

Please Help with the code below not sure where my error is...Thanks. Program output displayed here: Davy's auto shop services Oil change -- $35 Tire rotation -- $19 Car wash -- $7 Car wax -- $12 Enter the first service from the menu: Traceback (most recent call last): File "main.py", line 9, in choice1 = input("Enter the first service from the menu: "); EOFError: EOF when reading a line Here is the code: # Type your code here services = ["Oil change", "Tire rotation", "Car wash", "Car wax"] costs = [35, 19, 7, 12] print("Davy's auto shop services") for i in range(len(services)): print(services[i] + " -- $" + str(costs[i])) choice1 = input("Enter the first service from the menu: "); choice2 = input("Enter the second service from the menu: ");

0 0
Add a comment Improve this question Transcribed image text
Answer #1
if __name__ == '__main__':
    services = ["Oil change", "Tire rotation", "Car wash", "Car wax"]
    costs = [35, 19, 7, 12]
    print("Davy's auto shop services")
    for i in range(len(services)):
        print(services[i] + " -- $" + str(costs[i]))

    choice1 = input("Enter the first service from the menu: ")
    choice2 = input("Enter the second service from the menu: ")

Add a comment
Know the answer?
Add Answer to:
Please Help with the code below not sure where my error is...Thanks. Program output displayed here:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I dont know what I did wrong but I got 9/10. I need one more. Computer Sciencés Role in...

    I dont know what I did wrong but I got 9/10. I need one more. Computer Sciencés Role in Industry home > 4.10: Program Automobile service invoice (Python 3) E zyBooks catalo 4.10 Program: Automobile service invoice (Python 3) (1) Output a menu of automotive services and the corresponding cost of each service.(2 pts) Ex: Davy's auto shop services oil change $35 Tire rotation $19 Car wash$7 Car wax $12 (2) Prompt the user for two services from the menu....

  • I dont know what I did wrong but I got 9/10. I need one more. Computer...

    I dont know what I did wrong but I got 9/10. I need one more. Computer Sciencés Role in Industry home > 4.10: Program Automobile service invoice (Python 3) E zyBooks catalo 4.10 Program: Automobile service invoice (Python 3) (1) Output a menu of automotive services and the corresponding cost of each service.(2 pts) Ex: Davy's auto shop services oil change $35 Tire rotation $19 Car wash$7 Car wax $12 (2) Prompt the user for two services from the menu....

  • I am having trouble with my Python code in this dictionary and pickle program. Here is...

    I am having trouble with my Python code in this dictionary and pickle program. Here is my code but it is not running as i am receiving synthax error on the second line. class Student: def__init__(self,id,name,midterm,final): self.id=id self.name=name self.midterm=midterm self.final=final def calculate_grade(self): self.avg=(self.midterm+self.final)/2 if self.avg>=60 and self.avg<=80: self.g='A' elif self.avg>80 and self.avg<=100: self.g='A+' elif self.avg<60 and self.avg>=40: self.g='B' else: self.g='C' def getdata(self): return self.id,self.name.self.midterm,self.final,self.g CIT101 = {} CIT101["123"] = Student("123", "smith, john", 78, 86) CIT101["124"] = Student("124", "tom, alter", 50,...

  • Hi, can someone offer input on how to address these 4 remain parts the zybook python...

    Hi, can someone offer input on how to address these 4 remain parts the zybook python questions?   4: Tests that get_num_items_in_cart() returns 6 (ShoppingCart) Your output ADD ITEM TO CART Enter the item name: Traceback (most recent call last): File "zyLabsUnitTestRunner.py", line 10, in <module> passed = test_passed(test_passed_output_file) File "/home/runner/local/submission/unit_test_student_code/zyLabsUnitTest.py", line 8, in test_passed cart.add_item(item1) File "/home/runner/local/submission/unit_test_student_code/main.py", line 30, in add_item item_name = str(input('Enter the item name:\n')) EOFError: EOF when reading a line 5: Test that get_cost_of_cart() returns 10 (ShoppingCart)...

  • Please, I need help debuuging my code. Sample output is below MINN = 1 MAXX =...

    Please, I need help debuuging my code. Sample output is below MINN = 1 MAXX = 100 #gets an integer def getValidInt(MINN, MAXX):     message = "Enter an integer between" + str(MINN) + "and" + str(MAXX)+ "(inclusive): "#message to ask the user     num = int(input(message))     while num < MINN or num > MAXX:         print("Invalid choice!")         num = int(input(message))     #return result     return num #counts dupes def twoInARow(numbers):     ans = "No duplicates next to each...

  • Using python 3.6 How do I incorporate 0 or negative input to raise an error and...

    Using python 3.6 How do I incorporate 0 or negative input to raise an error and let the user try again? like <=0 #loop to check valid input option. while True: try: choice = int(input('Enter choice: ')) if choice>len(header): print("Invalid choice!! Please try again and select value either:",end=" ") for i in range(1,len(header)+1): print(i,end=",") else: break choice = int(input('\nEnter choice: ')) except ValueError as ve:print('Invalid response, You need to select the number choice from the option menu') # Catch your...

  • Can you add code comments where required throughout this Python Program, Guess My Number Program, and...

    Can you add code comments where required throughout this Python Program, Guess My Number Program, and describe this program as if you were presenting it to the class. What it does and everything step by step. import random def menu(): #function for getting the user input on what he wants to do print("\n\n1. You guess the number\n2. You type a number and see if the computer can guess it\n3. Exit") while True: #using try-except for the choice will handle the...

  • Hello I need help with python programming here is my code # Trivia Challenge # Trivia...

    Hello I need help with python programming here is my code # Trivia Challenge # Trivia game that reads a plain text file import sys def open_file(file_name, mode): """Open a file.""" try: the_file = open(file_name, mode) except IOError as e: print("Unable to open the file", file_name, "Ending program.\n", e) input("\n\nPress the enter key to exit.") sys.exit() else: return the_file def next_line(the_file): """Return next line from the trivia file, formatted.""" line = the_file.readline() line = line.replace("/", "\n") return line def next_block(the_file):...

  • can someone please double check my code here are the requirements please help me fulfill the...

    can someone please double check my code here are the requirements please help me fulfill the requirements Using the material in the textbook (NumberList) as a sample, design your own dynamic linked list class (using pointers) to hold a series of capital letters. The class should have the following member functions: append, insert (at a specific position, return -1 if that position doesn't exist), delete (at a specific position, return -1 if that position doesn't exist), print, reverse (which rearranges...

  • Zybooks 11.12 LAB*: Program: Online shopping cart (continued) Python 3 is the code needed and this...

    Zybooks 11.12 LAB*: Program: Online shopping cart (continued) Python 3 is the code needed and this is in Zybooks Existing Code # Type code for classes here class ItemToPurchase: def __init__(self, item_name="none", item_price=0, item_quantity=0): self.item_name = item_name self.item_price = item_price self.item_quantity = item_quantity # def __mul__(self): # print_item_cost = (self.item_quantity * self.item_price) # return '{} {} @ ${} = ${}' .format(self_item_name, self.item_quantity, self.item_price, print_item_cost) def print_item_cost(self): self.print_cost = (self.item_quantity * self.item_price) print(('{} {} @ ${} = ${}') .format(self.item_name, self.item_quantity, self.item_price,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT