65. Problem to get the difference between consecutive numbers in list.

In this Python list program, we will take a user input as a list and find the difference between consecutive numbers in a given list with the help of the below-given steps.

Difference between consecutive numbers in list:

Steps to solve the program
  1. Take a list as input.
  2. Combine the elements from the list using the zip() function.
  3. Find the difference between the consecutive numbers in the list.
  4. Add that difference to a new list.
  5. Print the list to see the output.

Output :

Related Articles

Extract strings of specified sizes from the list

Calculate the average of the list

Leave a Comment