write a python program to move spaces to the front of a given string.
Program:-
def move_Spaces_front(str1):
noSpaces_char = [ch for ch str1 if ch!= ' ']
spaces_char = len(str1) - len(nospaces_char)
result = ' '*spaces_char
result = '"'+result + ''.join(nospaces_char)+'"'
return(result)
print(move_spaces_front("sirfpadhai . in "))
print(move_spaces_front(" sirfpadhai.in "))
Output:-
" sirfpadhai.in"
" sirfpadhai.in"
flowchart:-