強弱と高低

Python3をメインに

2015-12-26から1日間の記事一覧

CheckiO Elementary Secret Message

自分の解答 def find_message(text): st="" for w in text: if w.isupper()==True: st=st+w return st forとifが連結できるだろうなと思いながら失敗したので普通の解答。 プロの解答 def find_message(text): return ''.join(c for c in text if c.isupper(…

CheckiO Elementary Monkey Typing

自分の解答 def count_words(text, words): count=0 for word in words: if (word in text.lower()) == True: count+=1 else: pass return count ちゃんとカウントという変数を用意している。Cでも読んでいる気分が否めない。。。 プロの解答 def count_word…

リストの要素の総和を求める

sum(lists) これだけだったw