Python字符串方法

有一个字符串对象 S1=“A bird in the hand is worth two in the bush”,请用字符串对象的方法实现以下需求:a.共包含几个空格;b.将该字符串以空格分为若干个单词


S1 = "A bird in the hand is worth two in the bush"
print('S1的空格数:', S1.count(' '))
# 拆分S1
S1 = S1.split(' ')
print(S1)

words=S1.split()
length=len(words)-1