What is the result of this code? nums = list(range(5)) print(nums[4]) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the result of this code? nums = list(range(5)) print(nums[4])

Any help? I tried to add the up but it didn't work and there is only space for one number By the way it'sin Pithon 3.0

19th Oct 2018, 3:53 PM
Popa Antonio
Popa Antonio - avatar
2 Answers
0
if you want to add them up use sum(): print(sum(range(5)))
19th Oct 2018, 4:57 PM
Kevin Dietrichstein
Kevin Dietrichstein - avatar
0
What is the result of this code? nums = list(range(5)) print(nums[4])
25th Sep 2020, 6:40 AM
RAVINDRAJEET GAUTAM
RAVINDRAJEET GAUTAM - avatar