Skip to content

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

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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:

start the program

Step 2:

Get the input from the user using eval(input())

Step 3:

Get the value from the user for the number of rotation

Step 4:

Using the slicing concept rotate the list

Step 5:

using concatenation operation display the entire rotated list

Step 6:

stop the program

Program:

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

Output:

image

Result:

Thus the python for circulate the values of n varaibles is executed successfully

About

Circulate the values of N variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published