What is the difference between these two ways to solve the question 2? could someone let me know it?

Hi, folks. I hope the best for all of us making daily progess!
I’m quite new here and currently I’m giving a try on python.
I’m up here to ask you what the difference of two ways that I’ve came up with to solve the question number 2 on the link;

for those who can access to the website, or for the unexpected incident on access, I’ll share you guys here a capture of the screen as well!
I hopefully find someone who save me haha
Have a lovely day!

This post was flagged by the community and is temporarily hidden.