A
A A
A A A
A A A A
A A A A A
Code:
n=5
for i in range(n):
for j in range(n):
print('A', end=' ')
print()
A
B B
C C C
D D D D
E E E E E
Code:
n = 5
p=65
for i in range(n):
for j in range(i+1):
print(chr(p), end=' ')
p+=1
print()
A
C C
E E E
G G G G
I I I I I
Code:
n = 5
p=65
for i in range(n):
for j in range(i+1):
print(chr(p), end=' ')
p+=2
print()
A
B B
A A A
B B B B
A A A A A
Code:
n = 5
for i in range(n):
for j in range(i+1):
if(i%2==0):
print("A", end=' ')
else:
print("B", end=' ')
print()
Z Z Z Z Z
0 0 0 0
Z Z Z
0 0
Z
Code:
n = 5
for i in range(n):
for j in range(i):
print(' ', end=' ')
for j in range(i, n):
if(i%2==0):
print("Z", end=' ')
else:
print("0", end=' ')
print()
A
B B B
C C C C C
D D D D D D D
E E E E E E E E E
D D D D D D D
C C C C C
B B B
A
Code:
n=5
p=65
for i in range (n-1):
for j in range (i,n):
print (' ', end = ' ')
for j in range (i):
print (chr(p), end = ' ')
for j in range (i+1):
print (chr(p), end = ' ')
p+=1
print()
for i in range (n):
for j in range (i+1):
print (' ', end = ' ')
for j in range (i,n-1):
print (chr(p), end = ' ')
for j in range (i,n):
print (chr(p), end = ' ')
p-=1
print()
A
B B B
C C C C C
D D D D D D D
E E E E E E E E E
D D D D D D D
C C C C C
B B B
A
Code:
n = 5
p=65
for i in range(n):
for j in range(i, n-1):
print(' ', end=' ')
for j in range(i+1):
print(chr(p), end=' ')
for j in range(i):
print(chr(p), end=' ')
p+=1
print()
p=69
for i in range(n+1):
for j in range(i):
print(' ', end=' ')
for j in range(i, n):
print(chr(p), end=' ')
for j in range(i, n-1):
print(chr(p), end=' ')
p-=1
print()
A
A B
A B C
A B C D
A B C D E
Code:
n = 5
for i in range(n):
p=65
for j in range(i+1):
print(chr(p), end=' ')
p+=1
print()
A B C D E
A B C D
A B C
A B
A
Code:
n = 5
for i in range(n):
p=65
for j in range(i):
print(' ', end=' ')
for k in range(i, n):
print(chr(p), end=' ')
p+=1
print()
A
A B C
A B C D E
A B C D E F G
A B C D E F G H I
Code:
n = 5
for i in range(n):
p=65
for j in range(i, n):
print(' ', end=' ')
for j in range(i+1):
print(chr(p), end=' ')
p+=1
for j in range(i):
print(chr(p), end=' ')
p+=1
print()
E
E D
E D C
E D C B
E D C B A
Code:
n = 5
for i in range(n):
p=69
for j in range(i+1):
print(chr(p), end=' ')
p-=1
print()
E D C B A
D C B A
C B A
B A
A
Code:
n= 5
k=69
for i in range(n):
p=k
for j in range(i):
print(' ', end=' ')
for j in range(i, n):
print(chr(p), end=' ')
p-=1
print()
k-=1
A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
Code:
n = 5
for i in range(n):
p=65
for j in range(i, n):
print(' ', end=' ')
for j in range(i):
print(chr(p), end=' ')
p+=1
for j in range(i+1):
print(chr(p), end=' ')
p-=1
print()
C
O O
D D D
E E E E
R R R R R
Code:
s = "CODER"
n = len(s)
p = 0
for i in range(n):
for j in range(i+1):
print(s[p], end = ' ')
p+=1
print()
R
E E
D D D
O O O O
C C C C C
Code:
s = "CODER"
n= len(s)
p= n-1
for i in range(n):
for j in range(i+1):
print(s[p], end=' ')
p-=1
print()
C
C O
C O D
C O D E
C O D E R
Code:
s = "CODER"
n= len(s)
for i in range(n):
p=0
for j in range(i+1):
print(s[p], end=' ')
p+=1
print()
R
R E
R E D
R E D O
R E D O C
Code:
s = "CODER"
n= len(s)
for i in range(n):
p=n-1
for j in range(i+1):
print(s[p], end=' ')
p-=1
print()
word : ‘CODER’
R E D O C
E D O C
D O C
O C
C
Code:
s = "CODER"
n = len(s)
k = n-1
for i in range(n):
p=k
for j in range(i):
print(' ', end=' ')
for j in range(i, n):
print(s[p], end=' ')
p-=1
print()
k-=1
49 videos|38 docs|18 tests
|
|
Explore Courses for Software Development exam
|