【发布时间】:2021-12-30 14:17:54
【问题描述】:
s="hellohel"
sub="hel"
count=0
for i in s:
if sub in s:
present = True
count+=1
else:
present = False
我得到输出:真 8 输出应该是:True 2
print(present,count)
【问题讨论】:
标签: python python-3.x