CAN someone solve this program ...
plz
Attachments:
Answers
Answered by
0
Explanation:
no
no no no no nooooooooooooooo
Answered by
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
Social Sciences,
1 month ago
English,
1 month ago
Computer Science,
1 month ago
Hindi,
2 months ago
Math,
9 months ago
Science,
9 months ago