I have a dict like:
a = {'1': [100,95,10,80,82,78,8,7,9,2],
'2': [98,99,11,82,107,78,8,69,2],
'3': [10,98,10,80,20,45,46,50,4,2]}
If the list of trend drops below 80% and continues below 80% code will print "trend is under 80%"
. The last value of keys will be excluded.
For example In '1': [100,95,10,80,82,78,8,7,9,2]
the last value is 2 so it will not be calculated.
Another example: In '1': [100,95,10,80,82,78,8,7,9]
100,95
drops over 80% to 10 and rises to 80 and continues around 80 and then drops to around 8. If this pattern is found in the code, it will write "value decreased under 80%"
.
To summarize, the value will drop over 80% and stability will continue under 80% till the end.
I can't use any library or define any function, only with if
, else
, for
, while
and something like that.