I have a problem I can't seem to get right.
I have 2 numbers, A & B. I need to make a list of A rows with B columns, and have them print out 'R0CO', 'R0C1', etc.
Code:
import sys
A= int(sys.argv[1])
B= int(sys.argv[2])
newlist = []
row = A
col = B
for x in range (0, row):
newlist.append(['R0C' + str(x)])
for y in range(0, col):
newlist[x].append('R1C' + str(y))
print(newlist)
This is not working. The following is the output I get and the expected output: Program Output
Program Failed for Input: 2 3 Expected Output:
[['R0C0', 'R0C1', 'R0C2'], ['R1C0', 'R1C1', 'R1C2']]
Your Program Output:
[['R0C0', 'R1C0', 'R1C1', 'R1C2'], ['R0C1', 'R1C0', 'R1C1', 'R1C2']]
Your output was incorrect. Try again
R0C. Look at this page for some techniques for formatting python strings