35.
Write aprogramto print
a pattern
as :
SOLUTION.
rows = 5
form inrange(O,rows):
forn inrange(0,m + 1):
*"
print(" end = "")
print()
Write a to the pattern
print
34. program
1
22
3 3 3
4444
55555
SOLUTION. rOWS = 5
fornum in range(1,
rowS+1):
for iin range(num):
print
(num, end =""
#itwill
print() forcethe
Writea prograM t0 printthe following
using
23.
loop(nonestedloops):
single
1
11
111
1111
11111
SOLUTION.
n =1
fora inrange(5) :
print(n)
=n* 10 1
n +
24. Writea program to print :
like
a pattern
4321
432
43
4
SOLUTION.
i
for inrange(4):
forjin range(4, i,
1):
end ="")
print(j,
else:
print()
16. Python
Write toprint
script thefollowing
pate
1
13
135
1357
SOLUTION.
for inrange(3,10,2)
a
forb inrange(1,a,2)
::
print () =')
print(b,
end
to a nested
illsutrate forloop.
Program
i
for inrange(1,6) :
i):
for jinrange(1,
("#,
print end='')
()
print
producedby above code
The output