Skip to content

Instantly share code, notes, and snippets.

@MustafaCoder2022
Created June 14, 2022 08:07
Show Gist options
  • Save MustafaCoder2022/622b16fa27a3f629ca571d3fd999ad97 to your computer and use it in GitHub Desktop.
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.
numbers =list(range(41))
print(numbers)
sum1=0
for i in numbers:
sum1 +=i
print(sum1)
@MustafaCoder2022
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment