Python Forum

Full Version: list evaluation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
after input and some evaluation I can reach the below list:
[1, 5, 7, 9, 5, 6, 20, 30]
for every number in that list, first number is price and the second number is the quality:
so price is: [1, 7, 5, 20] and the quality is :[5, 9, 6, 30]


i am going to find out the condition lower price and the best quality:
and print out 'its Ok' or 'its not ok'

for example in the upper list 'its not ok'

but for the below list the condition is 'ok'
[1,10,7,3]

the focus of the problem would be using while loop
Quote:I can reach the below list:
What does this mean?
Please show what you have tried.
You have a row of alternating green and red bricks. It starts with the green brick and has an index of 0.
Then a red brick with the index 1 follows. Then again a green brick with index 2... and so on

You can't see colors. You can see only the index numbers and you were told, that the index 0 starts with a green brick.
Your task is the same.

You have a list with even and odd elements. Just read more about the slice notation / index access of sequences.
Two or one compact line code solves the problem.