What is d result of this code ? Nums = [9, 8 ,7 ,6, 5] nums.append(4) nums insert (2,11) print (len (nums)) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is d result of this code ? Nums = [9, 8 ,7 ,6, 5] nums.append(4) nums insert (2,11) print (len (nums))

can u tell me d result of this code. please.

17th Sep 2018, 10:07 AM
Aryav Shenoy
Aryav Shenoy - avatar
3 Answers
+ 1
You cannot run it?
17th Sep 2018, 10:16 AM
KrOW
KrOW - avatar
+ 1
You have a list with n elements. list.append(<num>) appends <num> to the list. list.insert(<x>, <y>) inserts <y> at position <x> into the list. print(len(list)) prints the "length" of the list, i.e. how many items there are in the list.
17th Sep 2018, 12:07 PM
Anna
Anna - avatar
0
But why
17th Sep 2018, 11:24 AM
Aryav Shenoy
Aryav Shenoy - avatar