- 2
what is the result if this code num=[5,4,3,2,1] print(nums(1))
15 Respostas
+ 15
as it is it's an error
first, you are trying to access nums which does not even exists (you must have meant 'num')
second, using ( ) is used on callable objects (functions for instance)
if you wish to print the content of the list at index 1 it should be as following:
num=[5,4,3,2,1]
print(num[1]) # outputs 4
+ 4
4
+ 2
trust me the answer is 3. i've tried the 4 one but its wrong
+ 1
its 3
0
4
0
the answer is 3
0
its 3 I just tried it but hey whatever
- 1
THE ANSWER IS 4
- 1
it is 4
- 1
The answer is 4
- 1
Answer = 4
- 2
2
- 2
The answer is 2 braniacs
- 2
What is the result of this code?
nums = [1, 2, 3, 4, 5]
nums[3] = nums[1]
print(nums[3])
ans:2
- 3
the answer is 2
the answer is 2
the answer is 2
the answer is 2
the answer is 2
the answer is 2
the answer is 2