str = "*" list = [1,3,5,7,9,11,13,17,19,21] for i in range(0,21): if i in list: print((i*str).center(22," "))