Computer Science, asked by manassbp44131, 9 months ago

What is the out put of the following code list_1=[]
list_1.append([1(2,3),4])
print(list_1[0][1][1])

Answers

Answered by codiepienagoya
6

Output of the code:

Output:

The will give an error message.

Explanation:

In the given code there is some, that's why it will given an int type error message so, the correct code to this question can be described as follows:

Code:

list_1=[] #defining an empty list

list_1.append([1,(2,3),4]) #add number and tuple in list

print(list_1[0][1][1]) //print total value.

Explanation:

  • In the given python code an empty list "list_1" is declared, in the next line, the append method is used.
  • This method is used to adds the content at both the end of the items, in this list we add an add tuple and numbers.
  • Then the print method is used to prints its total elements, which is equal to 3.  

Learn more:

  • List in python program: https://brainly.in/question/13008948
Similar questions