Welcome to the parté…
Now you’ve arrived, read up on posting questions, especially how to post code blocks.
Aside: Your post doesn’t actually tell us what you want your program to do, or what it does wrong.
Luckily the snippets you provided were extremely simple to diagnose.
If it was any more complex, you would have received a more vociferous greeting from the helpers !
Enjoy the group.. we really do like to help.