Skip to content

Instantly share code, notes, and snippets.

@BexTuychiev
Created July 10, 2020 07:26
Show Gist options
  • Save BexTuychiev/b9709d6f4eaa598597e97a5e3e12718d to your computer and use it in GitHub Desktop.
Save BexTuychiev/b9709d6f4eaa598597e97a5e3e12718d to your computer and use it in GitHub Desktop.
# A function to reverse a string
def reverse_string(text: str, upper: bool = False) -> str:
reversed_text: str = text[::-1]
if upper:
return reversed_text.upper()
return reversed_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment