0% found this document useful (0 votes)
36 views

Python Sheets - Nested Loops

Well, if you wanna score amazing in 11th.use this

Uploaded by

lyttongoreegg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Python Sheets - Nested Loops

Well, if you wanna score amazing in 11th.use this

Uploaded by

lyttongoreegg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PYTHON PRACTICE SHEET

Q. Check the output of the following question:


1. for a in range(1,6):
for b in range(a,6):
print(b),
print
2. for a in range(2,6):
for b in range(1,a):
print(b),
print
3. for a in range(6,0,-1):
for b in range(1,a):
print(b),
print
4. for a in range(5,-1,-1):
for b in range(a,0,-1):
print(b),
print
5. for a in range(5,-1,-1):
for b in range(a,0,-1):
print(a),
print
6. for a in range(6,0,-1):
for b in range(1,a):
print(a),
print
7. for a in range(2,6):
for b in range(1,a):
print(a),
print
8. for a in range(1,6):
for b in range(a,6):
print(b),
print
9. for a in range(1,5):
for b in range(1,5):
print(a*b),
print
10. for a in range(1,6):
c=a
while(c>1):
print " ",
c=c-1
for b in range(a,6):
print(b),
print
11. for a in range(65,70):
c=a
while(c>65):
print " ",
c=c-1
for b in range(a,70):
print(chr(b)),
print
12. d=10
for a in range(1,5):
c=a
while(c>1):
print " ",
c=c-1
for b in range(a,5):
print(d),
d=d-1
print

You might also like