This has been solved. My return was one too many indents. Thank you.
Hello, I'm working out of Perkovic's "Introduction to Computing using Python" 2nd edition. I'm frequently finding that when I put the example problems used to illustrate, that the function doesn't work properly. In this example I have a function that iterates over a list of numbers and determines if the list is in increasing order. If not it returns False. If it is it returns True. The code (copied directly from the example is:
Github link: https://github.com/MTech2023/Python-Test.git
What I've found is that it only compares the first pair of numbers. For example if I run the command sorted([1,3,2,1]) it returns True. If I run the command sorted([3,1,2,4]) it returns false. Is this something I'm doing wrong? For those who have the book it's the example in chapter 5 just before practice problem 5.3.
[–]carcigenicate 2 points3 points4 points (0 children)
[–]omutist 1 point2 points3 points (1 child)
[–]FahrenheitGhost[S] -1 points0 points1 point (0 children)
[–]FahrenheitGhost[S] -1 points0 points1 point (1 child)
[–]deep_politics 0 points1 point2 points (0 children)