For this lab you must work with a partner that you have not previously submitted a lab with.
You will need to snarf files for this lab. Those files are also here
To get credit for lab, you will need to do the following by Sunday night:
Part 1 is an exercise in class you will work in a group of 3-4 people and then turn in.
You will be given legos of two different colors and a particular Lego pattern that grows with one additional lego each time. (Your lego pattern has two different colors also, but they may be different colors, just assume they are the same color as the legos in the pattern. ) You want to think about how the pattern grows each time you add another lego and how to give a general description of how the pattern is growing.
Follow the following steps.
Look at the file Information.py and the datafile athletes.txt (you can snarf the lab or see them here. )
Each line in the datafile has five parts of information about a person, with each part separated by a colon. Those five parts are first name, last name, gender (women or men), sport, and their height in inches (an integer).
Here is the data file:
Sean:Davis:men:soccer:72 Lexie:Brown:women:basketball:69 Jessica:Ho:women:tennis:65 Gurbani:Singh:women:golf:66 Harry:Giles:men:basketball:82 Nicolas:Alvarez:men:tennis:73 Quinn:Cook:men:basketball:74 Alyssa:Smith:women:tennis:65 DeVon:Edwards:men:football:69 Adam:Wood:men:golf:71 Brittain:Brown:men:football:73 Elizabeth:Williams:women:basketball:75 Cameron:Moseley:men:soccer:76 Celine:Boutier:women:golf:64 Amile:Jefferson:men:basketball:81 Ashton:Miller:women:soccer:67 Daniel:Jones:men:football:77 Chalena:Scholl:women:tennis:67 Josh:Levine:men:tennis:71 Casey:Martinez:women:soccer:65 Lisa:Maguire:women:golf:66 Grayson:Allen:men:basketball:77 Shaun:Wilson:men:football:69 Rebecca:Greenwall:women:basketball:73 Alexander:Matlari:men:golf:72 Kyra:Lambert:women:basketball:69 Austin:Parker:men:football:73 Jahlil:Okafor:men:basketball:83 Kendall:Cooper:women:basketball:76 Corbin:McCarthy:men:football:70 Luke:Kennard:men:basketball:77 Sandy:Choi:women:golf:67 Matt:Slotnick:men:soccer:68 Emily:Schubert:women:basketball:76 Imani:Dorsey:women:soccer:67 Ben:Humphreys:men:football:74 Marshall:Plumlee:men:basketball:84 Lizzy:Raben:women:soccer:69 Rebecca:Smaller:women:tennis:53
You should modify the code and answer the following questions in the google form.
[ ['Sean', 'Davis', 'men', 'soccer', '72'], ['Lexie', 'Brown', 'women', 'basketball', '69'], ['Jessica', 'Ho', 'women', 'tennis', '65'], ... REST NOT SHOWN ]We will call each list in this list, a list of athlete information.
What is the new line of code?
averageHeight
that has one parameter, a list of
lists of athlete information, and returns the average height (as a decimal number) of all the people in the
list.
heightRange
that has three parameters: a list of
lists of athlete information, and two integers
named height1 and height2, where height1 is less than or equal to height2. This function returns a list of lists of athlete
information for which their height is between height1 and height2 or
equal to height1 or height2.
Call this function to answer the question how many athletes are 6 ft or 6 ft 6 inches or between the two, and how many are there? What one line of code (that includes a call to this function) could print this answer?
group
that has three parameters:
a list of lists of athlete information, and two strings named gender
(value could be "men" or "women") and sport (Example, could be "soccer").
This function returns a list of lists of athlete information from
the given list that matches the gender (either men or women) and the
sport. For example if this function is called with gender equal to "women"
and sport equal to "basketball", then it should return a list of lists of
athlete information for only women basketball players.
Cut and paste your group function here.