Please quote your code.
Also, it is best to ask a more concrete question. Your code is neither optimal (because it uses globals) nor idiomatic, but may be fine for a trivial task, such as this exercise.
Please quote your code.
Also, it is best to ask a more concrete question. Your code is neither optimal (because it uses globals) nor idiomatic, but may be fine for a trivial task, such as this exercise.