Skip to content

Commit c09ca72

Browse files
authored
Create xyz_there.py
1 parent 1433157 commit c09ca72

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

String-2/xyz_there.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def xyz_there(str):
2+
while str.find('xyz') >= 0:
3+
x = str.find('xyz')
4+
if x == 0:
5+
return True
6+
elif x > 0:
7+
if str[x-1] != '.':
8+
return True
9+
str = str.replace('.xyz','')
10+
return False
11+
12+
# more on https://www.w3schools.com/python/ref_string_find.asp

0 commit comments

Comments
 (0)