Add python files

This commit is contained in:
lolabird 2023-10-19 14:52:00 -06:00
commit 27b5664ae7
7 changed files with 271 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# Runestone.Academy thinkcspy course
# Chapter 10
# Problem 11
def sumUntilEven(lst):
# your code here
sumlist = 0
for num in lst:
if num % 2 != 0:
sumlist += num
else:
return sumlist
return sumlist
mylist = [15, 85, 11, 20, 27, 38, 13]
oddlist = [13, 11, 29, 37]
print(sumUntilEven(mylist))
print(sumUntilEven(oddlist))