Added HowManyThatDigit

This commit is contained in:
BarsTiger
2021-07-08 18:09:46 +03:00
commit 9525237d2c

View File

@@ -0,0 +1,24 @@
print("©KOTIKOT, script by BarsTiger")
print()
typeFrom = int(input("All numbers from: "))
typeTo = int(input("All numbers to: "))
whichDigit = int(input("What should I find: "))
allNumbers = ""
digitCount = 0
for i in range(typeTo):
allNumbers = allNumbers + str(typeFrom + i)
allNumbersList = []
for i in range(len(allNumbers)):
allNumbersList.append(int(allNumbers[i]))
for n in range(len(allNumbersList)):
if allNumbersList[n] == whichDigit:
digitCount += 1
print()
print("I found " + str(digitCount) + " " + str(whichDigit) + "'s")