0
When i did number =3 and list=[string,0,[1+2+number],4.2] and print ([2]*[2]) then why there was an error
It was the programm of python in topic of string. number = 3 things = ["string", 0, [1+ 2+ number], 4.56] print(things[1]) print(things[2]) print(things[2]*[2])
4 odpowiedzi
+ 2
You can't multiply two lists.
print(things[2]) # [6] (list with one element)
print(things[2][0]*[2][0]) # = 6*6
+ 1
Makes sure the second argument is also things[2] and not just [2]
0
I did not get, actually i have edited code and multiply [2]*[2] and i have changed [1,2,number] to [1+2+number].
0
Thank u verry much i got it may allah bless u