Login and get codingWrite a function that takes an irregular shaped list of lists and makes it symmetrical by adding a
fillvalue
to each sublist:Example:
>>> jagged_list([[1, 1, 1, 1], [0, 0, 0, 0], [1]], fillvalue=1)
[[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1]]Hint: Some functions in the itertools module may be useful.
58 out of 59 users completed this Bite.
Will you be Pythonista #59 to crack this Bite?
Resolution time: ~22 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 2.67 on a 1-10 difficulty scale.
» You can do it! 😌