AlhambraMakers COMUNIDAD MAKER EN GRANADA

jornada test

jornada sobre python que se resolverá este código:

def reverseList(aList):
    if len(aList) <= 1:
        result = aList
    else:
        result = reverseList(aList[1:]) + [aList[0]]
    print(result)
    return result

aList = input("Please enter a list: ")
result = reverseList(aList)
print("Your reversed list is: {}".format(result))

My best guess after trying this out in both python 3 and python 2.7 environments is that the behaviour of the input() has changed since between the revisions. My guess again behind the change makes me think it was done to make people write better and more robust code as most security based attacks happen by parsing non sanitized input from stdin.

Tags: jornadas