Skip to content

Instantly share code, notes, and snippets.

@mrjohannchang
Last active August 29, 2015 13:56
Show Gist options
  • Save mrjohannchang/9265765 to your computer and use it in GitHub Desktop.
Save mrjohannchang/9265765 to your computer and use it in GitHub Desktop.
魏老師的挑戰狀2
#!/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