Skip to content

Instantly share code, notes, and snippets.

@m2kar
Created September 18, 2019 02:02
Show Gist options
  • Select an option

  • Save m2kar/315bdfb0581678d2f4159a6f7913b017 to your computer and use it in GitHub Desktop.

Select an option

Save m2kar/315bdfb0581678d2f4159a6f7913b017 to your computer and use it in GitHub Desktop.
"""
逆序 单词
"""
s=input()
if len(s)==0:
print("")
else:
enddot=False
if s[-1]==".":
s=s.rstrip(".")
enddot=True
s2=" ".join(s.split()[::-1])
if enddot:
print(s2+".")
else:
print(s2)
print(,end="")
@m2kar
Copy link
Author

m2kar commented Sep 18, 2019

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment