hey I am very new to coding and I have created this relatively simple code to do with my basic knowledge of the language. However I have had to do with some unwanted code including shutting it down if password is too long. so could anybody help me with any improvements to this.
Thanks in advance,
Josh
import timepasswordx = float(input('create your password'))
def password():
passwordx
if passwordx>9999:
print('password is wrong\n innitiating shutdown')
x=5
time.sleep(1)
print(x)
x-=1
time.sleep(1)
print(x)
x-=1
time.sleep(1)
print(x)
x-=1
time.sleep(1)
print(x)
x-=1
time.sleep(1)
print(x)
x-=1
time.sleep(1)
print(x)
x-=1
quit()
else:
print('code saved')
x=1
while x <1000:
print('###############')
x+=1
def login():
passwordguess = float(input('please enter password'))
if passwordguess == passwordx:
print('access granted')
else:
print('wrong')
print('here\'s a clue', (passwordx-passwordguess)**2)
login()
password()
login()
A few general things:
Architectures Optimization Reference Manual
PythonSpeed