K
kofi
Using python 3.1, I have written a function called "isEvenDigit"
Below is the code for the "isEvenDigit" function:
def isEvenDigit():
ste=input("Please input a single character string: ")
li=["0","2","4", "6", "8"]
if ste in li:
print("True")
else:
print("False")
I am now trying to write a function that takes a string as an argument and makes several calls to the isEvenDigit function in order to calculate and return the number of even digits in the string.How do i do this please? This is what i have done so far.
def isEvenDigit2():
number = input("Enter a digit: ")
Below is the code for the "isEvenDigit" function:
def isEvenDigit():
ste=input("Please input a single character string: ")
li=["0","2","4", "6", "8"]
if ste in li:
print("True")
else:
print("False")
I am now trying to write a function that takes a string as an argument and makes several calls to the isEvenDigit function in order to calculate and return the number of even digits in the string.How do i do this please? This is what i have done so far.
def isEvenDigit2():
number = input("Enter a digit: ")