文字列 S と文字 c が与えられるので、 c は S の何文字目に現れるかを調べてください。
何もみないで書いたやつ
S = input()
c = input()
order = 1
for i in S:
if i == c:
print(order)
break
else:
order += 1
答えはenumerate()
という関数を用いていました
これを用いると、配列の要素だけでなくインデックスも同時に取得可能
下記の様に書きます i, eleは変数名で変更可能。
s = input()
c = input()
for i, ele in enumerate(s):
if ele == c:
print(i + 1)