0
0

More than 1 year has passed since last update.

paizaラーニング「配列に含まれている? 2 Python3編」

Posted at

私の解答

n = int(input())
li = [5, 12, 6, 84, 14, 25, 44, 3, 7, 20]
output = False

for ele in li:
    if ele == n:
        print("Yes")
        output = True
        break

if not output:
    print("No")

前の解答例を参考にしたので、ほぼ同じになりました!

解答例

N = int(input())
li = [5, 12, 6, 84, 14, 25, 44, 3, 7, 20]
output = False

for ele in li:
    if N == ele:
        print("Yes")
        output = True
        break

if not output:
    print("No")
0
0
0

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
0
0