- 2

what is the result if this code num=[5,4,3,2,1] print(nums(1))

4th Sep 2017, 6:13 AM
sivapriya
15 odpowiedzi
+ 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
4th Sep 2017, 6:17 AM
Burey
Burey - avatar
+ 4
4
11th Mar 2019, 5:15 PM
Natalia
Natalia  - avatar
+ 2
trust me the answer is 3. i've tried the 4 one but its wrong
10th Dec 2021, 1:30 AM
zaira alya
+ 1
its 3
20th Dec 2021, 3:44 AM
Kavin
Kavin - avatar
0
4
15th Sep 2020, 7:01 AM
Divya Peddapalyam
Divya Peddapalyam - avatar
0
the answer is 3
20th Sep 2021, 1:57 AM
jose libardo avila leon
0
its 3 I just tried it but hey whatever
11th May 2022, 8:10 PM
Fear
- 1
THE ANSWER IS 4
26th Feb 2020, 2:07 PM
Rabia Boshory
Rabia Boshory - avatar
- 1
it is 4
4th Mar 2020, 2:00 PM
Sorifa Begum
Sorifa Begum - avatar
- 1
The answer is 4
2nd May 2020, 7:54 AM
Gaurav Bharat Patil
Gaurav Bharat Patil - avatar
- 1
Answer = 4
27th Aug 2021, 1:55 PM
PRINCE KUMAR
PRINCE KUMAR - avatar
- 2
2
6th Apr 2019, 12:13 PM
Lumeka Maleho
Lumeka Maleho - avatar
- 2
The answer is 2 braniacs
24th Mar 2020, 2:14 PM
Kamto
Kamto - avatar
- 2
What is the result of this code? nums = [1, 2, 3, 4, 5] nums[3] = nums[1] print(nums[3]) ans:2
26th Dec 2020, 5:52 AM
Ramukaved. K
Ramukaved. K - avatar
- 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
4th Jul 2019, 10:29 AM
Ubaydullah Rawat
Ubaydullah Rawat - avatar