Anasayfa
/
Teknoloji
/
54. what will be the output after the following statements? x=[[0.0,1.0,2.0],[4.0,5.0,6.0]] y=x[1][2] print (y)

Soru

54. What will be the output after the following statements? x=[[0.0,1.0,2.0],[4.0,5.0,6.0]] y=x[1][2] print (y)

Çözüm

4.4 (249 Oylar)
Ümran
Uzman doğrulaması
Kıdemli · 9 yıl öğretmeni

Cevap

The output will be 6.0. The variable x is a list of two elements, where the first element is a list with three floating-point numbers and the second element is another list with three floating-point numbers. The variable y is assigned the value of the element in the second list of x and the third index, which is 6.0. When the print statement is executed, it will output the value of y, which is 6.0.