First half in ascending, second half in descending

    0

    0

    CrypticSai-08

    def printOrder(arr,n) :
        # sorting the array
        arr.sort()
        # printing first half in ascending order
        i = 0
        while (i= n / 2 :
            print (arr[j])
            j = j - 1
    # Driver code
    arr = [5, 4, 6, 2, 1, 3, 8, 9, 7]
    n = len(arr)
    printOrder(arr, n)
    
    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.