Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List comprehension solution for Question 7 #144

Open
Sam-Gunawan opened this issue May 2, 2021 · 0 comments
Open

List comprehension solution for Question 7 #144

Sam-Gunawan opened this issue May 2, 2021 · 0 comments

Comments

@Sam-Gunawan
Copy link

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)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant