0
lists, I got the answer by guessing...
The question: nums=[1,2,3,4,5] nums[3]=nums[1] print(nums[3]) can someone explain how this answer is figured out?
4 Answers
+ 1
in python you should know that whenever there is an equals sign between two already assigned variables the always the value of the right sided variable will come in the left sided variable...
you should also note that this is not applicable to the right sided number that the value of left will come to it...
nums [3] = nums[1]
it means that the value of nums[ 1] is now in nums[ 3] ...so that is the reason behind it...
this feature is available in java also ....
I hope you understand. ... it....
have a nice day.....
0
yes thank u, that makes sense now