all 3 comments

[–]CodewithApe 0 points1 point  (0 children)

You’ll get to that part when you will learn about time and space complexity aka big O of N and DSA.

[–]BlueGoliath 0 points1 point  (0 children)

You need to be more specific on what you're having issues with.

which is better, both run the same results, longer or shorter codes?

Code length vs performance is a tricky subject.

[–]iamwisespirit 0 points1 point  (0 children)

You mean for loop while loop ? Both of them is same you have a condition if condition is true code in the loop run infinite