Praneet002 / Circulate-the-values-of-N-variables

Circulate the values of N variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circulate-the-values-of-N-variables

Aim:

To write a python program to circulate the n variables using function concept

Equipment’s required:

PC Anaconda - Python 3.7

Algorithm:

Step 1:

Step 2:

Step 3:

Get the value from the user for the number of rotation

Step 4:

Using the slicing concept rotate the list

Program:

def circulate():
    n=int(input())
    l=[10,20,30,40,50,60]
    l=l[n:]+l[:n]
    print("After circulating the values are:",l)

Output:

GitHub Logo

Result:

PROGRAM FINISHED SUCCESSFULLY.

About

Circulate the values of N variables

License:BSD 3-Clause "New" or "Revised" License