Answer the question
In order to leave comments, you need to log in
In a two-dimensional list, you need to push a value of the form 2 * 2 = 4
There is a two-dimensional list. It is necessary to fill it with expressions of the form 2*2=4.
Answer the question
In order to leave comments, you need to log in
if I understand the task correctly, then something like this (python 2.7):
>>> a=[['{0}*{1}={2}'.format(row,col,col*row) for col in xrange (1,5)] for row in xrange(1,5)]
>>> a
[['1*1=1', '1*2=2', '1*3=3', '1*4=4'], ['2*1=2', '2*2=4', '2*3=6', '2*4=8'], ['3*1=3', '3*2=6', '3*3=9', '3*4=12'], ['4*1=4', '4*2=8', '4*3=12', '4*4=16']]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question