Skip to content

sanjitp-23/Circulate-the-values-of-N-variables

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 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:

Define a function circulate().

Step 2:

Get the list from the user.

Step 3:

Get the value from the user for the number of rotation.

Step 4:

Using the slicing concept rotate the list.

Step 5:

print the circulated list.

Step 6:

End the program.

Program:

#Program to circulate N values.
#Developed by:Sanjit.P
#RegisterNumber:23002570
def circulate():
    value=eval(input())
    n=int(input())
    result=value[n:]+value[:n]
    print("After circulating the values are:",result)

Output:

output

Result:

Thus the program to circulate the N values is written and verified using python programmming.

About

Circulate the values of N variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published