@Sonia_012 have a look below as it is similiar to your case. It is implementing a mapping function for numbers to segments: