Lesson goal: Data Science: Find the minimum value in a file

Previous: Find the maximum value | Home | Next: Confusion with max and min

Once again, again suppose sample.dat contains a list of amounts spent by patrons during lunch at a retaurant. Let's see if we can tell the owner what his smallest (or minimum) sale amount was.

In other words, let's find the minimum number in the file sample.dat.

Now you try. Try to complete the code and find the minimum number in the file sample.dat.

Type your code here:

See your results here:

The code won't run as is, and as in the last lesson, we've left two challenges for you: 1) What should min be set to initially and 2) What should the if statement be?

Think carefully about what min should start out as... Dismiss.

Show a friend, family member, or teacher what you've done!

Here is a share link to your code:

Does your code work? Want to run it on your iPhone?

Here's your code:

  1. Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.

  2. Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into this page

  3. Then click the "Use on iPhone" button that you'll see.