* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Code:
n=5
for i in range(n):
for j in range(n):
print('*', end=' ')
print()
*
* *
* * *
* * * *
* * * * *
Code:
n = 5
for i in range(n):
for j in range(i+1):
print('*', end=' ')
print()
* * * * *
* * * *
* * *
* *
*
Code:
n = 5
for i in range(n):
for j in range(i, n):
print('*', end=' ')
print()
*
* *
* * *
* * * *
* * * * *
Code:
n = 5
for i in range(n):
for j in range(i, n):
print(' ', end=' ')
for j in range(i+1):
print('*', end=' ')
print()
* * * * *
* * * *
* * *
* *
*
Code:
n = 5
for i in range(n):
for j in range(i+1):
print(' ', end=' ')
for j in range(i, n):
print('*', end=' ')
print()
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
Code:
n = 5
for i in range(n):
for j in range(i, n):
print(' ', end=' ')
for j in range(i):
print('*', end=' ')
for j in range(i+1):
print('*', end=' ')
print()
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Code:
n = 5
for i in range(n):
for j in range(i+1):
print(' ', end=' ')
for j in range(i, n-1):
print('*', end=' ')
for j in range(i, n):
print('*', end=' ')
print()
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Code:
n = 5
for i in range(n-1):
for j in range(i, n):
print(' ', end=' ')
for j in range(i):
print('*', end=' ')
for j in range(i+1):
print('*', end=' ')
print()
for i in range(n):
for j in range(i+1):
print(' ', end=' ')
for j in range(i, n-1):
print('*', end=' ')
for j in range(i, n):
print('*', end=' ')
print()
49 videos|38 docs|18 tests
|
|
Explore Courses for Software Development exam
|