Add Chapter 9 exercises
This commit is contained in:
parent
af1eb1c281
commit
13203998df
24 changed files with 1054 additions and 0 deletions
15
thinkcspy/Chapter-9-Exercises/Python-files/Problem5.py
Normal file
15
thinkcspy/Chapter-9-Exercises/Python-files/Problem5.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 9
|
||||
# Problem
|
||||
|
||||
def numDigits(n):
|
||||
# your code here
|
||||
toText = str(n)
|
||||
count = 0
|
||||
|
||||
for i in range (len(toText)):
|
||||
count += 1
|
||||
|
||||
return count
|
||||
|
||||
print(numDigits(13))
|
||||
Loading…
Reference in a new issue