Last active
August 29, 2015 13:56
-
-
Save mrjohannchang/9265765 to your computer and use it in GitHub Desktop.
魏老師的挑戰狀2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
''' | |
請用少於 50 (UPD: 45) 個字元的 Python Code 將字串 s 每四個字元為一組反序呈現( s 的長度是 4 的倍數), 舉例 當 s="abcd1234efgh5678" | |
目前允許多行程式碼: 換行算一個字元, 一層縮排算一個字元 | |
''' | |
s = 'EFGHABCD56781234' | |
b='' | |
while s:b+=s[-4:];s=s[:-4] | |
s=b | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment