Skip to content

Commit e16301c

Browse files
committed
str_startswith_tutorial.py
1 parent e36ef8f commit e16301c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ Python Notes 學習筆記 📝
162162

163163
[queue_tutorial.py](queue_tutorial.py) - queue tutorial
164164

165+
[str_startswith_tutorial.py](str_startswith_tutorial.py) - str.startswith() tutorial
166+
165167
## 觀念
166168

167169
[python_circular_import](https://github.com/twtrubiks/python-notes/tree/master/python_circular_import) - [youtube tutorial - What is Python Circular Imports](https://youtu.be/RQhN24QtDAE)

str_startswith_tutorial.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def str_startswith():
2+
text = 'abcd'
3+
if text.startswith('ab'):
4+
print('yes')
5+
6+
7+
def str_endswith():
8+
text = 'abcd'
9+
if text.endswith('cd'):
10+
print('yes')
11+
12+
13+
if __name__ == "__main__":
14+
str_startswith()
15+
str_endswith()

0 commit comments

Comments
 (0)