Doubt in Programming (not repeating code)

This solved my problem, thank you very much. :smiley: