Added HowManyNumbersWithThisDigit.py

Added README for HowManyNumbersWithThisDigit.py
This commit is contained in:
BarsTiger
2021-08-29 14:04:54 +03:00
parent 90a6c22347
commit 289e9341ac
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
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 - typeFrom + 1):
allNumbers.append(typeFrom + i)
for n in allNumbers:
if str(whichDigit) in str(n):
digitCount += 1
print()
print("I found " + str(digitCount) + " " + str(whichDigit) + "'s")
input()

View File

@@ -0,0 +1,5 @@
Script, that helps with founding how many numbers with this digit from X to Y
Example: How many numbers with 0's from 1 to 10000
Скрипт, который помогает искать сколько числел с цифрой N от X до Y
Например: Сколько чисел от 1 до 10000 содержат 0?