Python Nested Loops To Print Rectangle With Asterisks

Here you go! Try this!

num_rows = 2
num_cols = 3

for i in range(num_rows):
    print('*', end=' ')
    for j in range(num_cols-1):
        i*=j
        print('*', end=' ')
    print('')

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)