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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!