Write a program to Count the number of spaces in a sring


Topic: Write a program to Count the number of spaces in a sring

Solution

s = "Count, the number of spaces"
lenx = s.count(' ')
print(f"number of spaces in sring: {lenx}")



List all Python Programs