mercredi 3 octobre 2018

(Python) I'm trying to convert this pattern into asterisks and spaces instead of 0's and 1's

I managed to get the pattern I want to print out, but I can't figure out how to convert these into asterisks. I need the pattern to be an asterisk for the 1s and a space for the 0s, in Python

for i in range(5):
        for j in range(5):
            print(int(j + i + 1)%2, end=' ')
        print()

Aucun commentaire:

Enregistrer un commentaire