Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
45
8
121
12.4K
Robin Fultz
Robin Fultz@robin16633·
@PythonPr B. y Because in Python a list starts with 0 (zero)
English
0
0
0
224
Hamid Shahid
Hamid Shahid@ch_hamid77·
@PythonPr Option b is correct. Because indexing starts from zero which means zero represents the first element which is 'p', 1 represents the 2nd element which is 'y' and so on for all the elements.
English
0
0
0
75
Yash
Yash@buildwithyash·
@PythonPr Option B In list the indexing start from zero so p will be zero index and y will be index 1
English
0
0
0
318
Premakumar Thevathasan (Prem Iyer)
Premakumar Thevathasan (Prem Iyer)@KumarT00623760·
@PythonPr answer is B. Y. In Python, list indexing starts at 0. Therefore, the element at index 1 of my_list is the second item, which is 'y'. my_list[0] is 'p' my_list[1] is 'y' my_list[2] is 't'
English
0
0
0
114
Paylaş