gaoliver / higher-value-table

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the higher value?

This is a exercise in Python really simple and interesting. You must only edit the list S to be the way you want it - understanding it as a table, with every "\n" representing a linebreak. So every sequence of string before and after each "\n" is a differente line of this table, being the first one the titles line.

S = "id,name,age,act.,room,dep.\n1,Jack,68,T,13,8\n17,Betty,28,F,15,7" # Edit this table

Or you can only create another list with your own table following the model and use it in the program.


How does it work?

You must call the function solution and pass the parameters S and C as seen below:

solution(S, C)
  • S - The table in string format, as in the model.
  • C - The parameter you want to filter in the table to find the higher value.

Example:


table = "id,name,age\n1,Gabriel,23\n2,Beatriz,22"

id name age
1 Gabriel 23
2 Beatriz 22

So you must do like:

print(solution(table, "age"))

And the return will be 23 because in the field "age" of the table, 23 is the higher.



OBS

This project is recommended to be used only for those who at least know how to run a Python project and basic coding.


Follow me: Instagram, LinkedIn, Twitter

About


Languages

Language:Python 100.0%