stringRev

    0

    0

    Mahendra Kumar

    goodPracticeprogramming

    printing the reverse of a string

    # Python code to reverse a string
    # using loop
    def reverse(s):
    str = ""
    for i in s:
    	str = i + str
    return str
    s = str(input())
    print ("The original string is : ",end="")
    print (s)
    print ("The reversed string(using loops) is : ",end="")
    print (reverse(s))
    
    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.