Skip to content

Instantly share code, notes, and snippets.

@bharathmuddada
Created May 29, 2021 12:53
Show Gist options
  • Select an option

  • Save bharathmuddada/0b51985fb2308e8a69224693334d6dde to your computer and use it in GitHub Desktop.

Select an option

Save bharathmuddada/0b51985fb2308e8a69224693334d6dde to your computer and use it in GitHub Desktop.
Left Rotate List in python
l=[10,20,30,40]
def leftrotate(l):
s = 1
e = len(l) - 1
temp = l[0]
print(l[e])
while s < len(l):
print(s)
l[s-1] =l[s]
# print(l[s])
s = s + 1
l[e] = temp
return l
print(leftrotate(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment