py help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

py help

What is the output of this code? list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]]

17th Jan 2020, 12:13 PM
Mansoor Hamisi Maluli
 Mansoor Hamisi Maluli - avatar
5 Answers
+ 6
There is a closing parenthesis missing at the end of the line with the print() statement. Then the code does run properly.
17th Jan 2020, 2:43 PM
Lothar
Lothar - avatar
+ 3
There is a codeplayground, use the searchbar to find your answer. Kindly delete this post as it is a duplicate and does not follow the rules of this community. Read more here: https://www.sololearn.com/discuss/1316935/?ref=app
17th Jan 2020, 12:16 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
In fact, googling for python print list list site:sololearn.com at least 7 similar questions came out. Do not worry anyway, you are not the only one to infringe rules!
17th Jan 2020, 12:47 PM
Bilbo Baggins
Bilbo Baggins - avatar
+ 3
If u close the paranthesis then u LL get 8 as output...
18th Jan 2020, 5:49 PM
Dheeraj
Dheeraj - avatar
0
yep close the parenthesis on the print statement. like this print(list[list[4]])
17th Jan 2020, 9:26 PM
Will Payne
Will Payne - avatar