vault backup: 2023-11-30 09:05:07

This commit is contained in:
Louis Gallet 2023-11-30 09:05:07 +01:00
parent f6b0111241
commit 9409d1dad5
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -13,12 +13,13 @@ def search(x: str, s:str) -> int:
@params s (str): the string
@return: (int): the number of occurences
"""
i = 1
n = len(s)
for loop in range(n):
if s[n] == x:
i += 1
return i
i = 0
pos = -1
while i < len(s) and pos == -1:
if s[i] == c:
pos = i
i += 1
return pos
def search2(s: str, x: str) -> int:
"""