How to convert the list into 2 tuple pair lists?

I'll give an example:

```L = [1,1,2,2,1,2]

/ i want the above list to

L2 = [(1,1) , (2,2) ,(1,2)]```
Nov 4, 2020 in Python 5,771 views

## 1 answer to this question.

This should work:

```L = [1, 2, 3, 4, 5, 6]
L2 = []

for i in range(0, len(L), 2):
L2.append((L[i], L[i+1]))

print(L2)```
• 65,910 points

## How to have values from a List1 into Columns Names and List 2 Values as Index for an Empty DataFrame

Try like this, it will give you ...READ MORE

## How to convert each list item into string in a column of data frame. ?

Hey, To split a string you can use ...READ MORE

## How to convert one list into generator?

Hi@akhtar, Say, you have one list A. Now convert ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

## Lowercase in Python

You can simply the built-in function in ...READ MORE