Created
June 14, 2022 08:07
-
-
Save MustafaCoder2022/622b16fa27a3f629ca571d3fd999ad97 to your computer and use it in GitHub Desktop.
Create a list of numbers 0 through 40 and assign this list to the variable numbers. Then, accumulate the total of the list’s values and assign that sum to the variable sum1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers =list(range(41)) | |
print(numbers) | |
sum1=0 | |
for i in numbers: | |
sum1 +=i | |
print(sum1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Write code to create a list of numbers from 0 to 67 and assign that list to the variable nums. Do not hard code the list.
nums = list(range(68))
print(nums)