Question: I am taking a Basis Programming course. We are working w/ Python coding and the assignment I turned in got rejected. I am having difficulty

I am taking a Basis Programming course. We are working w/ Python coding and the assignment I turned in got rejected. I am having difficulty grasping coding. When we turn in assignments we are supposed to indicate Pseudocode (which I clearly am not understanding), Input (this seems okay?) and Output (which I totally blew). I submitted the file in a text file and named it correctly, so I have that going for me :)

We were tasked with the following: Develop a Python application that incorporates using appropriate data types and provides program output in a logical manner. Your program should prompt a user to enter a car brand, model, year, starting odometer reading, an ending odometer reading, and the estimated miles per gallon consumed by the vehicle. Store your data in a dictionary and print out the contents of the dictionary. Below is what I submitted from my assignment and I just need someone to help me understand what I am doing wrong. What I am not grasping? Any guidance is greatly appreciated

# Pseudocode: 1. user enters car brand 2. user enters car model 3. user enters car year 4. user enters beginning miles 5. user enters ending miles 6. user enters miles per gallon

Professor comment: Are these comments? If so, the compiler rejects them.

Program Inputs: car = dict car = { 'brand': 'Enter brand of the car: ', 'model': 'Enter model of the car: ', 'year': 'Enter the year the car was made: ', 'start_odometer' : 'Enter the starting odometer reading: ', 'end_odometer': 'Enter the ending odomoter reading: ', 'mileage': 'Enter miles per gallon consumed by the vehicle: '}

print("Car details: ") car['brand'] = input("Enter brand of the car: ") car['model'] = input("Enter model of the car: ") car['year'] = int(input("Enter the year the car was made: ")) car['start_odometer'] = int(input("Enter the starting odometer reading: ")) car['end_odometer'] = int(input("Enter the ending odometer reading: ")) car['mileage'] = float(input("Enter miles per gallon consumed by the vehicle: ")) print(car)

Professor comment: This actually does look like Python code...

#Program Output:

Car details: Enter brand of the car: Hyundai Enter model of the car: Sonata Enter the year the car was made: 2017 Enter the starting odometer reading: 15 Enter the ending odometer reading: 20277 Enter miles per gallon consumed by the vehicle: 32.5 {'brand': 'Hyundai', 'model': 'Sonata', 'year': 2017, 'start_odometer': 15, 'end_odometer': 20277, 'mileage': 32.5}

Professor comment: No, it is inappropriate to include this here. Please re-post with ONLY PYTHON CODE, not extraneous text. The "0.01" is temporary until you do.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!