Hi, I have just started learning. Do you have any suggestions on how to improve my code?

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.