Program - Count the number of spaces in a sring
Topic: Program - 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
Solution
s = "Count, the number of spaces" lenx = s.count(' ') print(f"number of spaces in sring: {lenx}")