>>> t
[1, 3, 6]
>>> [j-i for i, j in zip(t[:-1], t[1:])] # or use itertools.izip in py2k
[2, 3]
More Related Contents:
- How to add numbers inside a variable? [closed]
- Is there a way to ordinate numbers in a list?
- finding the biggest sequence of repeating numbers in a list
- How to append new line to the list
- Remove all the elements that occur in one list from another
- Finding the average of a list
- Remove duplicate dict in list in Python
- How to efficiently compare two unordered lists (not sets) in Python?
- Filtering a list of strings based on contents
- How to switch position of two items in a Python list?
- Convert tuple to list and back
- Unpacking a list / tuple of pairs into two lists / tuples
- Call int() function on every list element?
- Find nearest indices for one array against all values in another array – Python / NumPy
- Splitting on last delimiter in Python string?
- Joining pairs of elements of a list [duplicate]
- Inserting a value into all possible locations in a list
- Convert string to list. Python [string.split() acting weird]
- How do you split reading a large csv file into evenly-sized chunks in Python?
- Make dictionary from list with python [duplicate]
- Find the index of an item in a list of lists
- What’s the difference between plus and append in python for list manipulation? [duplicate]
- Union find implementation using Python
- Assign multiple values of a list
- Deleting consonants from a string in Python
- How to zip two lists of lists
- Size of a Python list in memory
- Iterate a list with indexes [duplicate]
- How to extract all values from a dictionary in Python?
- Comparing 2 lists consisting of dictionaries with unique keys in python