def count_whitespaces_in_string(s):
whitespaces = len(s) - len(s.lower().replace(" ", "").replace("\n", "").replace("\r", "").replace("\t", ""))
return whitespaces
s = "Python \n Programming \r Language \t ";
print("Total white spaces:", count_whitespaces_in_string(s))
'''
run:
Total white spaces: 10
'''