samedi 23 juin 2018

How to print a multiple characters given variable number times?

Suppose if I want to print ".|." for (2k+1) times. Below is my snippet of code. How to do that? It is throwing a syntax error.

for k in range(0,n/2):
        print('.|.' * (2k+1))

Aucun commentaire:

Enregistrer un commentaire