Remove .md and image files and move python files into main chapter folders
This commit is contained in:
parent
5978779a9a
commit
67806dab6a
159 changed files with 0 additions and 4562 deletions
21
thinkcspy/Chapter-10-Exercises/Problem11.py
Normal file
21
thinkcspy/Chapter-10-Exercises/Problem11.py
Normal 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))
|
||||
Loading…
Reference in a new issue