読者です 読者をやめる 読者になる 読者になる

牌語備忘録 -pygo

あくまでもメモです。なるべくオフィシャルの情報を参照してください。

牌語備忘録 -pygo

引数リストのアンパックをジオン風にPythonでやってみた

Python

元は『http://www.python.jp/doc/release/tut/tut.html』の『4. その他の制御フローツール4.7.2 キーワード引数4.7.4 引数リストのアンパック』から。

Python

word01 = "Half of earth Federales fleet disappeared in space by my so lah lei now."
word02 = "This brightness is proof of justice of we zeon."
word03 = "It's already a ruin so that the earth federation war potential that received a coup de grace is left."
word04 = "I will say daringly! When it is refuse!!"

def zeon(czar, *word, **ms):
     yield "<character> %s" % czar
     for w in word:
          yield '%s: "%s"' % (czar, w)
     yield "\nMOBILE SUIT of ZEON ------------------------------"
     for m, p in ms.iteritems():
          yield "%s (model number:%s)" % (m,p)
print "\n".join(
     list(zeon("Gihren Zabi",
               word01, word02, word03, word04,
               ZAKU = "MS-05",
               ZAKU_II = "MS-06",
               GOUF = "MS-07",
               DOM = "MS-09",
               ACGUY = "MSM-04",
               ZGOK = "MSM-07",
               GYAN = "YMS-15",
               GELGOOG = "MS-14",
               ZEONG = "MSN-02",
               )))
実行結果



Gihren Zabi
Gihren Zabi: "Half of earth Federales fleet disappeared in space by my so lah lei now."
Gihren Zabi: "This brightness is proof of justice of we zeon."
Gihren Zabi: "It's already a ruin so that the earth federation war potential that received a coup de grace is left."
Gihren Zabi: "I will say daringly! When it is refuse!!"

MOBILE SUIT of ZEON ------------------------------
ZAKU (model number:MS-05)
GYAN (model number:YMS-15)
DOM (model number:MS-09)
ZGOK (model number:MSM-07)
ZAKU_II (model number:MS-06)
ZEONG (model number:MSN-02)
GOUF (model number:MS-07)
ACGUY (model number:MSM-04)
GELGOOG (model number:MS-14)



引用

台詞は英文共に下記から引用させて頂いた。。

「今や地球連邦軍艦隊の半数が我がソーラレイによって宇宙に消えた。この輝きこそ我らジオンの正義の証である。決定的打撃を受けた地球連邦にいかほどの戦力が残っていようとそれはすでに形骸である。あえて言おう!カスであると!!」

:

Half of earth Federales fleet disappeared in space by my so lah lei now. This brightness is proof of justice of we dione. It is already a ruin so that the earth federation war potential that received a coup de grace is left. I will say daringly! When it is refuse

英訳をお願いします。「今や地球連邦軍艦隊の半数が我がソーラレイによ... - Yahoo!知恵袋

モビルスーツ名など

Category:ジオン公国の機動兵器 - Wikipedia