arglist = [(2, 90), (1, 140), (3, -40), (4, 60)]
for args in arglist:
    do.something(*args)
    time.sleep(1)
    print "Did something (%d,%d)" % args

The * means "use the values in this tuple as the arguments". Hint: you can do the same with keyword arguments by using ** and a dict.

Answer from Matti Virkkunen on Stack Overflow
People also ask

How can I convert between different sequence types in Python?
You can convert sequences using built-in functions like list() to turn a tuple or string into a list, or tuple() to create a tuple from a list. For strings, use ''.join() to convert a list of characters back to a string. These conversions are useful for switching between mutable and immutable types as needed in your code.
🌐
purpletutor.com
purpletutor.com › home › understanding code › mastering python sequences guide for lists tuples and strings
Sequence in Python master list tuple string operations efficient ...
What are the three types of sequences in Python?
The three main types of sequences in Python are lists, tuples, and strings. Lists are mutable and allow modifications, while tuples and strings are immutable. These sequences support common operations like indexing, slicing, and iteration.
🌐
purpletutor.com
purpletutor.com › home › understanding code › mastering python sequences guide for lists tuples and strings
Sequence in Python master list tuple string operations efficient ...
When should I use a list versus a tuple in Python?
Use a list when you need a mutable collection that may change, such as adding or removing items dynamically. Opt for a tuple when you want an immutable sequence for fixed data, like constants or function return values. Tuples are also more memory-efficient and can serve as dictionary keys, unlike lists.
🌐
purpletutor.com
purpletutor.com › home › understanding code › mastering python sequences guide for lists tuples and strings
Sequence in Python master list tuple string operations efficient ...
🌐
Infx511
infx511.github.io › lists.html
Chapter 4 Lists and Sequences | Introduction to Programming
While lists are mutable (changeable) sequences of data, tuples represent immutable sequences of data. These are useful if you want to enforce that a data value won’t be changed, such as for a function argument (or a dictionary key; see Chapter 10). Indeed, many built-in Python functions utilize tuples.
🌐
Compciv
2017.compciv.org › guide › cookbook › basic-sequences.html
Python Sequence Basics
Python sequences start at position 0. Thus, to reference the element at what we humans consider the nth position, e.g. 3rd, we use the index value of n - 1, e.g.
🌐
Stack Overflow
stackoverflow.com › questions › 72078996 › how-do-i-turn-a-list-of-lists-into-separate-integer-sequences
python - How do I turn a list of lists into separate integer sequences? - Stack Overflow
Probably you meant for i in range(len(integerSequences)):. But even better would be for i, seq in enumerate(integerSequences):. Then you can refer to both i (the index) and seq (the sequence) rather than to i and integerSequences[i]. ... @Stef: They could even use for i, seq in enumerate(integerSequences, 1): so they don't need to do i + 1, in the one place they still use i.
Find elsewhere
🌐
Medium
medium.com › @madhuri15 › python-sequence-lists-a-complete-guide-54ec7ed88323
Python Sequence — Lists a complete guide | by Madhuri Patil | Medium
December 27, 2022 - Python has several data structures which used to group other values. These data structures of Python refers to as containers. The list is one of the containers of Python which used to store the homogeneous values or objects in specific order or sequence.
🌐
Purple Engineer
purpletutor.com › home › understanding code › mastering python sequences guide for lists tuples and strings
Sequence in Python master list tuple string operations efficient coding 🚀🐍
January 22, 2026 - The sequence protocol also supports advanced features like negative indexing and step values in slicing. When you use seq[-1], Python automatically converts this to seq[len(seq) - 1] before calling __getitem__().
🌐
Fsu
ww2.cs.fsu.edu › ~nienaber › teaching › python › lectures › sequence-list.html
Sequences | List
Since list is an object it has many methods available to the programmer that allows such actions as testing the values of a string, performing modifications, and searching for substrings and replacing sequences.
🌐
Python.org
discuss.python.org › ideas
Introduction of `tuple.item()` / `list.item()` / `Sequence.item()` to convert sequence to scalar - Ideas - Discussions on Python.org
September 9, 2022 - I propose to introduce list.item() and tuple.item() (and possibly Sequence.item() in general) as a concise way to convert sequences with of length 1 to a scalar value, the same as NumPy does: https://numpy.org/doc/stabl…
🌐
Runestone Academy
runestone.academy › ns › books › published › py4e-int › lists › sequence.html
9.1. A list is a sequence — Python for Everybody - Interactive
The first example is a list of four integers. The second is a list of three strings. The elements of a list don’t have to be the same type.
🌐
Makitweb
makitweb.com › home › python › sequences and lists in python
Sequences and Lists in Python
June 28, 2022 - In Python, a sequence is a set of ordered list. They are differentiated by their index number. The index starts from zero.
🌐
Stack Overflow
stackoverflow.com › questions › 62526672 › convert-the-list-of-sequence-list-to-one-hot
python - convert the list of sequence list to one hot - Stack Overflow
Copyfrom nltk.tokenize import word_tokenize from itertools import chain from keras.preprocessing.sequence import pad_sequences a = ['hi', 'oh thanks i m fine this is an evening in my timezone'] a_tokens = [word_tokenize(word) for word in a] tokens_dict = {word:i for i, word in enumerate(set(chain.from_iterable(a_tokens)))} tokens_sequence = [[tokens_dict[word_t] for word_t in word] for word in a_tokens]
🌐
Prospero Coder
prosperocoder.com › home › sequence conversions in python
Sequence Conversions in Python - Prospero Coder
May 4, 2022 - Today we’ll be talking about sequence conversions. In particular we’ll learn how to convert any sequence to a list or tuple. ... Comprehensive, for Kivy beginners, easy to follow. ... Cool stuff, easy to follow articles. Get the magazine here (PDF). ... Learn the basics of Python, including OOP.
🌐
Python
docs.python.org › 2.4 › lib › typesseq.html
2.3.6 Sequence Types -- str, unicode, list, tuple, buffer, xrange
October 18, 2006 - There are six sequence types: strings, Unicode strings, lists, tuples, buffers, and xrange objects.
🌐
Tutorialspoint
tutorialspoint.com › python › list_list.htm
Python List list() Method
These sequence types can be anything: sets, tuples, strings, dictionaries etc. As we might already know, objects in Python are divided into two categories: mutable and immutable. Lists, sets and dictionaries are mutable objects while tuples and strings are immutable. So when this method converts a tuple or a string into a list, the object becomes mutable.
🌐
Medium
medium.com › @gauravverma.career › sequence-in-python-705f9904313f
Sequence in Python. Sequence is any ordered set in python… | by Gaurav Verma | Medium
December 7, 2025 - str1 = "Gaurav " + "Verma" print(str1) #output is " Gaurav Verma" tuple1 = (1, 2, 3) + (4, 5, 6) print(tuple1) #output is (1, 2, 3, 4, 5, 6) list1 = [1, 2, 3] + ["4", "5"] print(list1) #output is [1, 2, 3, "4", "5"} 2. * : repeats the sequence.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-create-list-of-numbers-with-given-range
Create List of Numbers with Given Range - Python - GeeksforGeeks
Explanation: np.arange(r1, r2).tolist() uses NumPy's arange() function to generate a sequence of numbers from r1 o r2 .tolist() method converts the NumPy array into a Python list.
Published: July 11, 2025