Cars! 🚗

Another activity I did was to create a program that would open and read a file called 93cars.dat.txt, gotten from this page, and calculate the following:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

I had worked with text files in a previous problem, so I went back to my post about it in order to remember the proper commands:

After that, this is the program I wrote:


And that’s it! ❤

2 thoughts on “Cars! 🚗

  1. Pingback: WSQ 13 – Python

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s