I'm trying to get user input (x), and then print x rows, and x/2 columns. I cannot get it to work. I keep only getting two columns of data, with duplicate rows. I'm supposed to complete this using a nested for loop that only loops once (per assignment). I have the following code:
x = int(input("Enter a number: "))
val = x//2
for row in range(x):
for column in range(val):
print(row, column)
My goal is to have this type of output if the user inputs 4, for example:
1 1 2
2 1 2
3 1 2
4 1 2
But, this is what I'm getting if a user inputs 4:
0 0
0 1
1 0
1 1
2 0
2 1
3 0
3 1