Skip to content

List comprehension solution for Question 7 #144

Open
@Sam-Gunawan

Description

@Sam-Gunawan

I found a more efficient way of solving Question 7 using list comprehension. HOWEVER, this is not for beginners, it's just a fun way of solving it. Let me know what you think about my solution.

arrays, elems = map(int, input().split(','))
print([[i * j for j in range(elems)] for i in range(arrays)])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions