Even-ascending Sequences X24460


Statement
 

pdf   zip   main.py

thehtml

Write a funcion even_ascending that receives a list of integers and returns True if elements in even positions form a strictly ascending sequence, and False otherwise.

Remember that lists positions are numbered starting at zero, which is even.

Observation

Submit just the function with no main program. If you have a test main, comment it out, or put it inside a conditional if __name__ == "__main__"

Sample session
>>> even_ascending([1, 4, 5, 2, 8, 5, 10, 9, 23])
True
>>> even_ascending([4, 6, 7, 9, 7, 10, 7, 1, 12, 3, 22])
False
>>> even_ascending([5])
True
>>> even_ascending([3, 2])
True
>>> even_ascending([3, 2, 1])
False
Information
Author
Lluís Padró
Language
English
Official solutions
Python
User solutions
Python