dimanche 20 septembre 2015

Pattern Printing python

I would like to print a pattern of when user input a value the pattern sequence will show:

***
*X*
***

XXX
X*X
XXX

XXX
XXX
XXX

Currently I can only derived till it prints out all using for loop in range:

***
*X*
***

***
*X*
***

Anyone knows how to change the second pattern above to:

***
*X*
***

XXX
X*X
XXX

Aucun commentaire:

Enregistrer un commentaire