Challenges 7
Challenges 7
7a). Copy out the table found below into Python. The data is [Name, Age, Height(m), Hair Colour]
People_Data=[ ["Mary",31,1.5,"Blonde"], ["Steve",21,1.8,"Brunette"], ["Martin",37,1.77,"Blonde"], ["Mohammed",60,1.67,"Brunette"], ["Candice",16,1.25,"Brunette"] ]
Low: Print out each element in the 2D array.
Med: Print out each person in the array one at a time exactly as shown below.
High: Calculate the average Age and Height of the group and print it out.
Super High:
The user enters a name then you search through database and print out all the people's data that matches the name. If it matches no one then say not found.
7b). Copy out the 2d game board array below into Python. It is a 5x5 grid which represents a board. Space is a blank square and there are three coloured pieces you can place on the board, represented by R,G or B.
Game_Board=[["R"," ","G"," "," "],
[" ","R"," ","B"," "],
["R"," "," "," ","R"],
["B"," ","G"," "," "],
[" ","R","R","R"," "]]
Med: Let the user enter 2 coordinates and then print out the piece in that spot. If space print the word "Blank", R "Red", G "Green" and B "Blue".
High:
Red is 1 point, Green is 2 and Blue is worth 3.
Calculate how many points the player has on the board
Super Super High: A player gets 10 bonus points if any colour is 3 in a horizontal row, like in the bottom example show (vertical does not apply). Loop through and check if any are triples and then add the 10 bonus points to their score for each one.
7c). Not Done
Low:
Med:
High:
For the solution click here!