number of spaes pythopn

Solutions on MaxInterview for number of spaes pythopn by the best coders in the world

showing results for - "number of spaes pythopn"
Emna
07 Apr 2017
1# '.isspace() ' return True of False for if a character is a space
2
3word = "How many spaces"
4num = 0
5for i in word:
6  if(i.isspace() == True):
7    num += 1
8print(num) #Output: '2'