LearnPy Hub
← Comprehensions problems
Medium

Grid Coordinates

Read r and c. Print a list of all (row, col) tuples for rows 0..r−1 and columns 0..c−1, using a comprehension with two for parts.

Input

Two integers.

Output

A Python list.

Sample 1

Input
2
3
Output
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]

Sample 2

Input
1
1
Output
[(0, 0)]
solution.py
Output appears here
Grid Coordinates · Python practice problem · LearnPy Hub