UNI_Python/ext_01/quick.py

8 lines
212 B
Python
Raw Normal View History

2024-02-20 22:18:38 +01:00
count = 0
for i in range(10000): # Start from 100
num_str = str(i).zfill(4) # fill with zeros
if len(set(num_str)) == 3:
count += 1
print(f"Total numbers with three different digits: {count}")