Rotate a list by n numbers

You have to rotate a list by N number

Introduction

Suppose you have a list, and you want to rotate it by n numbers

data = ["one", "two", "three", "four", "five", "six", "seven"]

Now if you want to rotate it to 2 numbers.

data = ["six", "seven", "one", "two", "three", "four", "five"]

Published by Faizan Amin

I am a web and android developer

Leave a comment

Design a site like this with WordPress.com
Get started