Question d’entretien chez CareerBuilder

Question #1 sent over email: Given a string, write a function or method that takes in that string, and returns the same string in reverse order. · Example: Given the string “Hello”, your program would return “olleH” · Do not assume that “Hello” is the only string it will handle

Réponse à la question d'entretien

Utilisateur anonyme

23 nov. 2016

I guess it is pretty straight forward in python def reverse_string(string): return string[ : :-1] print(reverse_string("Hello"))