Created
October 8, 2018 13:42
-
-
Save KatiGithub/710b5df1650e76149b8e0b63c2a9ccfa to your computer and use it in GitHub Desktop.
This Python file calculates the number of letters and integers in an input or string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strchar = [] | |
intchar = [] | |
inpt = input("Input: ") | |
inpt = list(inpt) | |
for i in range(0, len(inpt)): | |
if inpt[i].isalpha(): | |
strchar.append(inpt[i]) | |
elif inpt[i].isdigit(): | |
intchar.append(inpt[i]) | |
print(str(len(strchar)) + " letter(s)") | |
print(str(len(intchar)) + " number(s)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment