1
0

More than 3 years have passed since last update.

python3 記録

Posted at

配列から数値に変換

n = int(input())

a = input().split()

print(a)
for i in range(n):
    print(a[i])

print(a[i])

これでリストから対象の番号を参照して1つずつ表示してくれる

任意の文字列を含むか判定: in演算子

a = input()
b = input()

if a in b:
    print("YES")
else:
    print("NO")
1
0
1

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