
- Python 3 Basic Tutorial
- Python 3 - Home
- What is New in Python 3
- Python 3 - Overview
- Python 3 - Environment Setup
- Python 3 - Basic Syntax
- Python 3 - Variable Types
- Python 3 - Basic Operators
- Python 3 - Decision Making
- Python 3 - Loops
- Python 3 - Numbers
- Python 3 - Strings
- Python 3 - Lists
- Python 3 - Tuples
- Python 3 - Dictionary
- Python 3 - Date & Time
- Python 3 - Functions
- Python 3 - Modules
- Python 3 - Files I/O
- Python 3 - Exceptions
Python program to find the Decreasing point in a List
When it is required to find the decreasing point in a list, a simple iteration and the ‘break’ statement are used.
Example
Below is a demonstration of the same −
my_list = [21, 62, 53, 94, 55, 66, 18, 1, 0] print("The list is :") print(my_list) my_result = -1 for index in range(0, len(my_list) - 1): if my_list[index + 1] < my_list[index]: my_result = index break print("The result is :") print(my_result)
Output
The list is : [21, 62, 53, 94, 55, 66, 18, 1, 0] The result is : 1
Explanation
A list of integers is defined and is displayed on the console.
An integer variable is assigned a value.
The list is iterated over, and the elements in consecutive indices are checked.
If the second index is less than first, the index is assigned to the integer variable.
The control breaks out of the loop.
This is the output that is displayed on the console.
- Related Articles
- Program to check whether list is strictly increasing or strictly decreasing in Python
- Program to find maximum element after decreasing and rearranging in Python
- Python program to find the String in a List
- Program to find the highest altitude of a point in Python
- Python program to find the largest number in a list
- Python program to find the smallest number in a list
- Program to find length of longest strictly increasing then decreasing sublist in Python
- Python program to find largest number in a list
- Python program to find the second largest number in a list
- Program to find folded list from a given linked list in Python
- Python Program to Find the Largest Element in a Doubly Linked List
- Python Program to Find the Length of a List Using Recursion
- Python program to find Cumulative sum of a list
- Program to find number not greater than n where all digits are non-decreasing in python
- Program to find the middle node of a singly linked list in Python

Advertisements