'Is there a way to get a variable in rows and columns
How to get output like this in python from for loop
Input = 2
Result =
**
**
Solution 1:[1]
Option 1: Nested for
for i in range(2):
for j in range(2):
print('*', end='')
print('\n')
Option 2: String multiplication
for i in range(2):
print('*' * 2)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | True Seeker |
