Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

rotatelist

Krishna Maru answered on February 11, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • rotate list python
  • rotate list python
  • python rotate list
  • rotate linked list
  • left rotation in list
  • rotatelist in python

  • rotatelist

    0

    def rotatelist(l,k):

    retlist = l[:]

    if k <= 0:

    return(retlist)

    for i in range(1,k+1):

    retlist = retlist[1:] + [retlist[0]]

    return(retlist) 

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Feb 11 2023
    Krishna Maru
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.