Count the number of spaces in a string.
Implement count_spaces(s) to return the number of literal space characters (' '). Do not count tabs, newlines, or other whitespace characters.
count_spaces(s)
' '
s
def count_spaces(s):
Your question is Count Spaces in String. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.