Q. Let nums2 and nums3 be two non-empty lists. Write a Python command that will append the last element of nums3 to the end of nums2.
Answer :-
nums2.append(nums3[ -1 ])
Explanation :-
nums3[ -1 ] return last element of lis nums3.
nums2.append(nums3[ -1 ]) will append last element of nums3 to nums2.
Can u explain it properly please
ReplyDeleteExplanation :-
Deletenums3[ -1 ] return last element of lis nums3.
nums2.append(nums3[ -1 ]) will append last element of nums3 to nums2.
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )