#python
#pythonprogramming
Python MCQ Questions and answers,
Python MCQ , Python Programming,
Python mutable objects,
list, mutable list, list is mutable,
reverse, print,
lst.reverse(), reverse the list in-place,
Reverses items of the list in-place since list is mutable and returns None.
Function arguments in Python are evaluated from left to right before the function call.
Ex: print()
NIELIT M3-R5 Course 'O' Level Certification,
#pythontutorial #pythonforbeginners #pythonlists
#pythonlist
#pythondeveloper #pythoncoding #learnpython
#pythonquiz #python3 #pythonskills #codingpython
#pythonbasics #pythonbeginner #pythonprogramming
#datascience #dataanalytics
#codingquiz #quizchallenge #codingcommunity
#freshers #techtalk #top10
#interviewpreparation #interviewhacks #interviewquestions #interviewskills
Ace your Python exams with this MCQ marathon!
Covers various Python concepts, including input/output, data structures, and more.
#PythonMCQs #PythonInterview #CodingQuiz #PythonProgramming #TechSkills
#ssitlecturestamil @ssitlecturestamilதமிழ்
Mutable, Assigned copy share same reference of it's original.
Any change in original,
Mutable→change in-place
lst.reverse()
Reverses items of the list in-place since list is mutable and returns None.
Function arguments in Python are evaluated from left to right before the function call.
Ex: print()
list x created as ['a',5]
print fn
1)x evaluated,x→['a', 5]
2)x.reverse() evaluated, modifies x in-place,
⇒x=[5, 'a'] (reversed),returns None
3)prints [5, 'a'] since x already changed, None
print evaluates arguments as: first x, second x.reverse() which reverses x in-place because of list's mutability so x value is reversed and then prints x which has reversed value and None returned by x.reverse().
⇒x printed is reversed order since reverse() happened during argument evaluation, before actual printing.
⇒Fact that list.reverse() changes the list in-place is due to list's mutable nature.
List:
Sequences(Compound data type), collection of ordered items separated by ',' within [ ].
Информация по комментариям в разработке