How can you write a Python program for this structogram?

hello, i have no idea how to write program for this structogram. can it be possible that somebody please shows me the solution?:disappointed_relieved: