Question d’entretien chez Apple

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

Réponses aux questions d'entretien

Utilisateur anonyme

6 avr. 2015

string[::-1]

1

Utilisateur anonyme

25 déc. 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