DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python left rotation
def rotate(l, n): return l[n:] + l[:n] print(rotate([1, 2, 3, 4, 5], 2)) #output : [3, 4, 5, 1, 2]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#left
#rotation
ADD COMMENT
Topic
COMMENT
Name
7+5 =
Submit