Computer Science, asked by NJD38, 1 month ago

Write a python program using loops to print the following pattern:

[tex]+ \; + \; + \; + \; + \; + \; + \; + \\
+ \; + \; + \; \; \; \; \; + \; + \; + \\
+ \; + \; \; \; \; \; \; \; \; \; + \; + \\
+ \; \; \; \; \; \; \; \; \; \; \; \; \; + \\
+ \; \; \; \; \; \; \; \; \; \; \; \; \; + \\
+ \; + \; \; \; \; \; \; \; \; \; + \; + \\
+ \; + \; + \; \; \; \; \; + \; + \; + \\
+ \; + \; + \; + \; + \; + \; + \; + [/tex]

Answers

Answered by xXItzSujithaXx34
2

rows = int(input("Enter the number of rows: "))

# Outer loop will print number of rows.

for i in range(rows+1):

# Inner loop will print the value of i after each iteration.

for j in range(i):

print(i, end=" ") # print number.

# line after each row to display pattern correctly.

print(" ")

Answered by llFollowll27
1

{\huge{\boxed{\tt{\color {red}{Answer❀✿°᭄}}}}}

  • rows = int(input("Enter the number of rows: "))
  • # Outer loop will print number of rows.
  • for i in range(rows+1):
  • # Inner loop will print the value of i after each iteration.
  • for j in range(i):
  • print(i, end=" ") # print number.
  • # line after each row to display pattern correctly.
  • print(" ")
Similar questions