Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Jan 22nd, 2019
69
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.18 KB
| None
|
0
0
raw
download
clone
embed
print
report
"""
Creates 2D matrix
"""
def matrix(rows, cols, start=0):
return [[c + start + r * cols for c in range(cols)] for r in range(rows)]
assert matrix(2, 3, 1) == [[1, 2, 3], [4, 5, 6]]
Add Comment
Please,
Sign In
to add comment
Public Pastes
Освоение циклов
C# | 3 min ago | 0.52 KB
CarpetBackup
Lua | 4 min ago | 1.62 KB
Magenta style
LScript | 6 min ago | 36.36 KB
Shinada style
LScript | 12 min ago | 20.90 KB
Breaker style 1st
LScript | 20 min ago | 36.78 KB
Breaker style 2rd
LScript | 22 min ago | 36.04 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 26 min ago | 0.39 KB
Villian style
LScript | 29 min ago | 39.23 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!