0

Greetings I'm having some problems I can't understand metrix problems

How the answer is coming 4 https://code.sololearn.com/cKoF6oJebb4M/?ref=app

23rd May 2023, 7:41 AM
Mazhar Shafique
Mazhar Shafique - avatar
4 Respostas
+ 6
Mazhar Shafique , since you already have started? the *introductiontopython* tutorial, please continue learning from that.
23rd May 2023, 9:59 AM
Lothar
Lothar - avatar
+ 2
x=[2 ,4] x= x * 3 print(x[3]) When you multiply a list with a number, it replicates the elements that many times inside the list. You can print(x) and see it will be x=[2,4,2,4,2,4] So element and 3rd index is 4.
23rd May 2023, 8:27 AM
Avinesh
Avinesh - avatar
+ 1
The first x= x*3 , repeats the [2, 4] list three times to [2, 4, 2, 4, 2, 4 ] Now from your python basics you know that the first item is 0, now counting from zero to 4 (X[3]) the number there is 4 Savvy¿
23rd May 2023, 10:54 AM
Cool-Coder
Cool-Coder - avatar
0
Oooooo thanku
29th May 2023, 5:59 PM
Mazhar Shafique
Mazhar Shafique - avatar