Question: Modify the following Python code so that instead of returning the time in seconds, it returns the time in minutes. def numberPossiblePasswords(numDigits, numPossiblePerDigit): numPasswords =
Modify the following Python code so that instead of returning the time in seconds, it returns the time in minutes.
def numberPossiblePasswords(numDigits, numPossiblePerDigit):
numPasswords = numPossiblePerDigit**numDigits
return numPasswords
def maxSecondsToCrack(numPossiblePasswords, secPerAttempt):
time = numPossiblePasswords*secPerAttempt
return time
nd = int(input("How many digits long is the passcode? "))
nc = int(input("How many possible characters are there per digit? "))
secondsPerAttempt = .08
npp = numberPossiblePasswords(nd, nc)
totalSeconds = maxSecondsToCrack(npp, secondsPerAttempt)
print("It will take you " + str(totalSeconds) + " seconds maximum to crack the password.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
