📅  最后修改于: 2022-03-11 14:46:22.680000             🧑  作者: Mango
# '.isspace() ' return True of False for if a character is a space
word = "How many spaces"
num = 0
for i in word:
if(i.isspace() == True):
num += 1
print(num) #Output: '2'