You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
181 B
13 lines
181 B
2 years ago
|
|
||
|
def find_in_string(s, c):
|
||
|
|
||
|
for pos in range(0,len(s)):
|
||
|
if(s[pos] == c):
|
||
|
return pos
|
||
|
return -1
|
||
|
|
||
|
|
||
|
print(find_in_string('Homer','e'))
|
||
|
print(find_in_string('Homer','n'))
|
||
|
|