Sollicitatievraag bij Apple

Reverse a string in Python without using str.reverse()

Antwoorden op sollicitatievragen

Anoniem

6 apr 2015

string[::-1]

1

Anoniem

25 dec 2018

x = "Reverse a string in Python without using str.reverse()" print("".join([x[j] for j in range(len(x)-1, -1, -1)])) print(x[::-1])

1