C3_W4 problem with data_generator

I am having a problem with my data_generator. I get:

[[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21], [32, 33, 4, 34, 6, 35, 36, 21], [32, 38, 4, 41, 11, 42, 43, 44, 45, 21]]
[[4, 22, 6, 23, 7, 24, 8, 25, 26, 11, 27, 28, 7, 29, 30, 16, 31, 18, 19, 20, 21], [30, 37, 4, 38, 39, 34, 6, 40, 36, 21], [32, 33, 4, 46, 47, 43, 48, 45, 21]]
Output for questions in batch 1 has the wrong size.
Expected (3, 32).
Got (3, 4).

I suspect the problem is with my calculation of determine longest question in input1 & input2
An example of what I get for the first iteration of input1 is:

[[30, 87, 78, 134, 2132, 1981, 28, 78, 594, 21], [30, 55, 78, 3541, 1460, 28, 56, 253, 21]]

This doesn’t look right.

I see the numbers in the expected values but I am padding wrong. I seem to be missing something. Am I really looking at multiple lists to find the longest question?

Just in case, my lab id is xcbszllt

Any advice would be appreciated.

Cheers,
Drew

P.S - I would like to finish the assignment by May 30th.

Please click my name and message your notebook as an attachment.

@drew_Frances
Consider a single list made of nested lists. Here’s how you find the length of the longest sublist:

>>> my_list = [
... [1,2,3],
... [2,3,4,5,10],
... [1]]
>>> max(len(sublist) for sublist in my_list)
5

With this in mind, please do the following:

  1. Find the length of the longest question in input1
  2. Find the length of the longest question in input2
  3. max_len = Find the greater of the 2 quantities calculated in steps above.

The for loop doesn’t use q1 and q2 in your implementation. Please read the steps carefully keeping in mind that input1 and input2 are python lists.

Thanks a lot for the help!!! I guess I didn’t quite understand the data structures. And I see my silly mistake in the for loop!

Cheers,
Drew