Python Practice › Tuple Programs › Program 46

List of tuples to list of lists

EasyTuple Programs · 46 of 70

Write a Python program to convert a list of tuples into a list of lists.

Advertisement
Input
[(1, 5), (7, 8), (4, 0)]
Output
[[1, 5], [7, 8], [4, 0]]

Approach

  1. list(t) for each tuple.

Solution

Python
print([list(t) for t in [(1, 5), (7, 8), (4, 0)]])
Output
[[1, 5], [7, 8], [4, 0]]

Learn the concept

New to this topic? Read the lesson, then come back.

More tuple programs

← All 70 Tuple Programs

Leave a Comment