By k positions the circular rotations of array

    0

    1

    CrypticSai-08

    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)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.