a=list(map(int,input("ENTER ARRAY ELEMENTS ").split()))
      k=int(input("ENTER NO.OF ROTATIONS "))
      print("ARRAY BEFORE ROTATION ",*a)
      k=k%len(a)
      for i in range(k):
          x=a.pop(-1)
          a.insert(0,x)
      print("ARRAY AFTER  ROTATION  ",*a)
      
      Python language logo

      By k positions the circular rotations of array

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.