Code not passing test cases

my code is not passing test cases,not able to understand my mistake ,can you please explain how many spaces are required in each line and correct my code
code id - 240706

required no space at start of 4 as u can see
image
ur o/p
image
has
space


less complex code