0
Make a one line Python statement that uses both sum and range to print the sum of the numbers 1 through 10
Someone help me with this please
4 Réponses
+ 6
Is this what you are looking for?
print(sum(range(1, 10)))
(if I understand 'through' properly - it means 'up to but not including', right?)
+ 4
Oh, then just change 10 to 11 and we're done :)
+ 1
Yeah that's what I did. My mistake was with the parentheses. Thanks again :)
0
Thanks a lot Kuba. I think 10 should be included.