list = [ 42, 55, 67] print(list[ 2 ]) Explain me this Question?
Hi, 3rd entry of list is asked
A list is a construct tha allwos the storage of mutiple elements. The syntax goes as follows: "the name of your list in this case just "list" = [ ] or [element nr.1,element nr.2 ... Etc] You can instanciate a list empty or pre filled deppending on the example above. You cann acces elements inside a list by calling the name of the list and nr of the possition of the element you want to acces For example we have a list just like in your case List = [42,55,67] If you want to acces 42the first element ib the list you would need to call List the first element is marked as 0 cause Computer logic, the second element is List and so on depending on the size of your list you can't acces a element outside of the lisg range in this case List would cause an error.
I didn't understand why the result is 2. In a list we start counting from 0, later 1,2,3 and so on.. We have 3 elements: [42, 55, 67] so my logic say that the 3rd element it is 67. Why is it 2 of the first element if 42 it is the zero position? Thank you so much who will reply me
its ans is :- [ 2
Problem Statement Given two integers a and b, your task is to calculate and print the following four values:
Please help, any idea?
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
What is wrong? Error on test.