Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 list evaluation
#1
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
#2
Quote:I can reach the below list:
What does this mean?
Please show what you have tried.
Quote
#3
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.
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Evaluation of two different list in python? go127a 8 761 Apr-22-2019, 12:49 PM
Last Post: snippsat
  operand evaluation order? insearchofanswers87 2 788 Sep-26-2018, 07:51 PM
Last Post: insearchofanswers87
  Recursive evaluation in parsley parser mqnc 0 1,130 Apr-13-2018, 09:02 PM
Last Post: mqnc
  Learning Python, newbie question about strings and evaluation new_learner_999 13 1,894 Feb-18-2018, 03:01 PM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)