Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Last active May 8, 2021 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/79ab8c8a973e45c76a88442a9ab3c161 to your computer and use it in GitHub Desktop.
Save computer-tutor/79ab8c8a973e45c76a88442a9ab3c161 to your computer and use it in GitHub Desktop.
l = input('Enter a List: ').split() # input().split() returns the list
l = l[len(l)-1:] + l[:-1] # last element being added at
#the start with the list slice that doesn’t contain the last element
print('Rotated list is::',l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment