premkumarkarthikeyan / 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:

Get the two values from the user

Step 2:

Assign the value of second variable to a temporary variable

Step 3:

Get the value from the user for the number of rotation

Step 4:

Using the slicing concept rotate the list

Step 5:

Assign the value of second variable to a temporary variable

Step 6:

End program

Program:

#Program to circulate N values.
#Developed by: PREM KUMAR K 
#RegisterNumber:21222230111
def circulate():
    list1=eval(input())
    n=int(input())
    result=list1[n:]+list1[:n]
    print("After circulating the values are:",result)

Output:

1b python

Result:

The output for circulate the values of n variables is successfull

About

Circulate the values of N variables

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