Mar-21-2024, 11:12 AM
(This post was last modified: Mar-22-2024, 01:32 AM by MoreMoney.
Edit Reason: Improve
)
Trying to make completion time faster and stable, anyone have better code for that?
Here is my try
Here is my try
import time def find_pin(pin): start_time = time.time() pin_int = int(pin) for guess in range(1000000): if guess == pin_int: end_time = time.time() print(f"PIN found: {guess:06}") print(f"Completion time: {end_time - start_time} seconds") break # Example usage: pin_input = input("Enter a 6-digit PIN: ") find_pin(pin_input)
buran write Mar-21-2024, 02:41 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.