0
How do you make a code that will take an input word and output it backwards?
2 Réponses
+ 1
Ace's solution is the most concise one, and thus preferred by experts. For a beginner, splitting the tasks would probably be easier to understand:
string = input("Enter a string to be reversed:\n")
reverse_string = (string[::-1])
print("Reverse string: ", reverse_string)
Semantically, the both codes are identical. The only difference is in comprehensibility for a learner.