2017年12月24日 星期日

b007: 倒背如流 (**)

b007: 倒背如流 (**)
"""
我們形容一個人把文章背得很熟,甚至可以倒著背的情況
,叫做「倒背如流」。不過如果可以把英文單字的字母
倒著背回來,又是另一個層次的問題了,你能做到嗎?

輸入說明:
輸入一個字串。
輸出說明:
將輸入的字串依相反的字元順序輸出。

範例輸入:
輸入1:
Hello

輸入2:
World
範例輸出 :

輸出1:
olleH

輸出2:
dlroW
"""

print("輸入一個字串。",end='')
strX=str(input("--> "))

print(strX[::-1])



====================== RESTART: F:/Python_APSC/b007.py ======================
輸入一個字串。--> hello
olleh
>>> 
====================== RESTART: F:/Python_APSC/b007.py ======================
輸入一個字串。--> World
dlroW
>>>

沒有留言:

張貼留言

2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2

 2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2 AngularJS 實例 <!DOCTYPE html> <html> <head> &...