A character string input and output position of the first character appears.
Input formats:
- Line 1: Input string
- Line 2: Enter a character
Output formats:
- Find, output corresponding location, format
index=X
, andX
indicate find location - Could not find output
can't find letter X
,X
expressed Find character
Sample input:
python
t
Sample output:
index=3
Sample input:
python
l
Sample output:
can't find letter l
s = input() a = str(input()) b = True; count = 0 for e in s: count = count + 1 if e == a: print("index=%d" % count) b = False break if b == True: print("can't find letter {}".format(a))