字符串
>>> "dwfre" 'dwfre' >>> 'wf' 'wf' >>> "afwer ''"#文本里含有单引号,那么外面就要用双引号 "afwer ''" >>> 'weftr "" '#文本含有双引号,那么外面就要用单引号 'weftr "" ' >>> 'wfrg '' ' 'wfrg ' >>> "wefd ''" "wefd ''" \ >>> ''' fwerg dgff""efer ''sfger ''' ' fwerg\ndgff""efer\n\'\'sfger ' >>> ''' fwerg dgff""efer wgatt ''wefr ''' ' fwerg\ndgff""efer\nwgatt \'\'wefr '#文本含有单双引号,用三引号 >>> s = 'sgfter \' ' # \后面的‘不是字符结束标志,只是普通的字符
s = ['所','个','人','的']
for i in range(4):
print(s[i])
def f(s):
cnt = 0
#注意tab
for c in s:
if c in 'edf':
cnt+=1
return cnt
print(f("defifff"))
6