Computer Science, asked by sg7pro, 2 months ago

CAN someone solve this program ...
plz​

Attachments:

Answers

Answered by shivampandey96080
0

Explanation:

no

no no no no nooooooooooooooo

Answered by PrateekBairagi
1

Answer:

x=int(input("Enter the choice:"))

if x==1:

   def num(n):      

       num = 1

# outer loop to handle number of rows

   # n in this case

       for i in range(0, n):

# inner loop to handle number of columns

       # values changing acc. to outer loop

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

               print(num, end=" ")

               num = num + 1

           print("\r")

   n = 4

   num(n)

   

elif x==2:

   def tri(r):

# the outer loop is executing in reversed order  

       for i in range(r + 1, 0, -1):

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

               print("*", end=' ')  

           print(" ")  

   r=5

   tri(r)

   

else:

   print("Wrong choice")

Hope it's help you

Similar questions