Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
11 views

Python Assignment 8

Uploaded by

PAVAN
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Python Assignment 8

Uploaded by

PAVAN
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

113220561

Pavan Dange

#Q1

for i in range(1, 6):

for j in range(6 - i):

print(i, end=' ')

print()

#Q2

for i in range(5, 0, -1):

for j in range(i):

print(5, end=' ')

print()

#Q3

for i in range(6, 0, -1):

for j in range(i):

print(j, end=' ')

print()

#Q4

i=1

while i <= 9:

print((str(i) + ' ') * i)

i += 2

#Q5
for i in range(1, 9):

for j in range(1, i + 1):

print(i * j, end=' ')

print()

#Q6

for i in range(6):

print('$' * (6 - i) + ' ' * (2 * i) + '$' * (6 - i))

#Q7

n=5

for i in range(1, n + 1):

print('* ' * i)

for i in range(n - 1, 0, -1):

print('* ' * i)

Output:

11111

2222

333

44

55555

5555

555
55

012345

01234

0123

012

01

333

55555

7777777

999999999

24

369

4 8 12 16

5 10 15 20 25

6 12 18 24 30 36

7 14 21 28 35 42 49

8 16 24 32 40 48 56 64

$$$$$$$$$$$$

$$$$$ $$$$$

$$$$ $$$$

$$$ $$$

$$ $$

$ $

**
***

****

*****

****

***

**

PS C:\Users\pavan> python -u "C:\Users\pavan\AppData\Local\Temp\tempCodeRunnerFile.python"

11111

2222

333

44

55555

5555

555

55

012345

01234

0123

012

01

333

55555

7777777

999999999
1

24

369

4 8 12 16

5 10 15 20 25

6 12 18 24 30 36

7 14 21 28 35 42 49

8 16 24 32 40 48 56 64

$$$$$$$$$$$$

$$$$$ $$$$$

$$$$ $$$$

$$$ $$$

$$ $$

$ $

**

***

****

*****

****

***

**

You might also like