Answers for "how to find count of no of space between string in python"

0

number of spaes pythopn

# '.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'
Posted by: Guest on May-26-2020

Code answers related to "how to find count of no of space between string in python"

Python Answers by Framework

Browse Popular Code Answers by Language