Given a number n. The task is to print n-integers n-times (starting from 1) and right rotate the integers by after each iteration.
Input : 6 Output : 1 2 3 4 5 6 2 3 4 5 6 1 3 4 5 6 1 2 4 5 6 1 2 3 5 6 1 2 3 4 6 1 2 3 4 5 Input : 3 Output : 1 2 3 2 3 1 3 1 2
Below is the implementation.
1 2 3 2 3 1 3 1 2
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python program to right rotate a list by n
- Program to cyclically rotate an array by one in Python | List Slicing
- Decimal Functions in Python | Set 2 (logical_and(), normalize(), quantize(), rotate() ... )
- Python | Ways to rotate a list
- Python PIL | paste() and rotate() method
- SymPy | Polyhedron.rotate() in Python
- Python | Decimal rotate() method
- Python | Sympy Ellipse.rotate() method
- Wand rotate() function in Python
- Wand rotate() function - Python
- Python OpenCV - cv2.rotate() method
- Python - Rotate dictionary by K
- String slicing in Python to rotate a string
- Program to print binary right angle triangle
- Program to print right and left arrow patterns
- turtle.right() method in Python
- Python | Using 2D arrays/lists the right way
- Python - Right and Left Shift characters in String
- Right Click menu using Tkinter
- PyQt5 - Check Box with Indicator at right side
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : krishna_6431