LoginSignup
1
0

More than 5 years have passed since last update.

CheckIO(home:house password) python使用

Last updated at Posted at 2018-02-15

使用したサイト checkIO 問題(home:house password)

・躓いたポイント
a = "hogehoge" とstr文字配列がある。
for char in aと取り出す際に取り出したcharに""が付いていることに気付かなかった

example 誤)
a = "hogehoge"
for char in a:
if not "char".isdgit():

取り出したcharに""も含まれるため、正しくは
example 正)
a = "hogehoge"
for char in a:
if not char.isdgit():
のような記述でよかった

今日使用した python構文
listname.count(2)
となると、リスト内に2と重複している数を表示してくれる
a = [1,2,3,2,] の場合は a.count(2) は2になる。

またpythonで文字、数字を確認する方法
"文字".isdigit() 全部数字ならTrueを返す
"文字".islower() 全部小文字ならTrue
"文字".isupper() 全部大文字ならTrue
https://docs.python.jp/3/library/stdtypes.html?highlight=isupper#str.isupper

boolean型
http://www.python.ambitious-engineer.com/archives/204


回答のなかにリスト内包表記というものがあった。
今後学習が必要

友達にコンパスっているプラットフォームとかで勉強のコミュニティーに
入ったら?と言われた
他のお勧めサイト、paiza AtCoder(プログラミングコンテストサイト)
もいいらしい。

1
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0