Public feed #726214

Someone

public text v1 · immutable
Raw Edit
·published 2007-10-04 23:31 UTC
rendered paste body
# Reverse String Code

def reverse(s):
    '''Return a copy of s, reversed.'''
    rev= '' #The reverse of the chars in s that I've seen s far
    for c in s:
        rev = c + rev
    return rev

print reverse ("Happy")


#Reverse List code

def reverse(list):
    ''' This function takes a list into the paramter "list" and create
    a new list with all the elements of the original list reversed'''
    
    rev_list = []
    for u in list:
        rev_list.append(u)
    return rev_list