So I'm pretty new to python and it's our first language in college. I am having a hard time putting the "Row #x:" in my code:
x = int(input("Enter the number of rows: "))
y = int(input("Enter the number of columns: "))
n=1
for i in range(x):
for j in range(y):
print(n, end=" ")
n = n+1
print()
Output:
Enter the number of rows: 3
Enter the number of columns: 3
1 2 3
4 5 6
7 8 9
So this is how it's supposed to look like if the "Row #x:" if its included:
Enter the number of rows: 3
Enter the number of columns: 3
Row #1: 1 2 3
Row #2: 4 5 6
Row #3: 7 8 9
The number of rows depends on how many rows the user has inputted. Anything to share with me on how am I supposed to do it?