Tuesday 6 February 2024

Class 11 CS Practical - 15

 

15 - Write a program in Python to generate the following pattern using nested loops:

*

**

***

****

*****


for i in range(1,6):

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

        print("*",end='')

    print()

 

Output:

*

**

***

****

*****


Class 11 CS Practical - 14

 

14 - Write a program in Python to generate the following pattern using nested loops:

A

AB

ABC

ABCD

ABCDE


for i in range(1,6):

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

        print(chr(j+64),end='')

    print()


Output:

A

AB

ABC

ABCD

ABCDE


Class 11 CS Practical - 13

 

13 - Write a program in Python to generate the following pattern using nested loops:

5

54

543

5432

54321


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

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

        print(j,end='')

    print()


Output:

5

54

543

5432

54321


Class 11 CS Practical - 12

 

12 - Write a program in Python to generate the following pattern using nested loops:

54321

5432

543

54

5


for i in range(1,6):

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

        print(j,end='')

    print()


Output:

54321

5432

543

54

5


Class 11 CS Practical - 11

 

11 - Write a program in Python to generate the following pattern using nested loops:

55555

4444

333

22

1


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

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

        print(i,end='')

    print()

 

Output:

55555

4444

333

22

1


Class 11 CS Practical - 10

 

10 - Write a program in Python to generate the following pattern using nested loops:

12345

1234

123

12

1


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

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

        print(j,end='')

    print()

 

Output:

12345

1234

123

12

1


Class 11 CS Practical - 09

 

9: Write a program in Python to generate the following pattern using nested loops:

1

22

333

4444

55555


for i in range(1,6):

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

        print(i,end='')

    print()

Output:

 

1

22

333

4444

55555


Class 11 CS Practical - 08

 

8 - Write a program in Python to generate the following pattern using nested loops:

1

12

123

1234

12345


for i in range(1,6):

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

        print(j,end='')

    print()

Output:

1

12

123

1234

12345


Class 11 CS Practical - 07

 

7. Write a program in Python to generate the following pattern using nested loops:

11111

22222

33333

44444

55555

for i in range(1,6):

    for j in range(1,6):

        print(i,end='')

    print()

Output:

11111

22222

33333

44444

55555

Class 11 CS Practical - 06

 

6. Write a program in Python to generate the following pattern using nested loops:

12345

12345

12345

12345

12345


for i in range(1,6):

    for j in range(1,6):

        print(j,end='')

    print()

Output:

12345

12345

12345

12345

12345