yazdırılır o None
demek iki çizgi izledi goodbye
yazdırır. Bunu nasıl ortadan kaldırırım?tanımlanmış deyimi yürütüldüğünde sonra aşağıdaki kodu çalıştırın ve bütün <code>request</code> işlevi geçmesi ve ben <code>reqSecPass</code> kısmına <code>n</code> cevap zaman "yok", iki kez
goodbye
ifadesinin kendiliğinden olduğunu ve bunun bir fark yaratıp yaratmadığını bilmiyorum.
def goodbye():
print('Good Bye!')
def request():
reqPass = input('Which password would you like?[Google, Twitter, Reddit, Computer]')
#still need to figure out dictionary manipulation so this is a temporary sytem.
if(reqPass == 'google' or reqPass == 'google'):
print('________________')
print('Pass: GOOGLEPASSWORDHERE')
print('________________')
reqSecPass = input('Request another password?[y/n]')
if(reqSecPass == 'y' or reqSecPass == 'Y'):
print(another())
else:
print(goodbye())
elif(reqPass == 'twitter' or reqPass == 'Twitter'):
print('_________________')
print('User: TWITTERUSERNAMEHERE')
print('Pass: TWITTERPASSWORDHERE')
print('________________')
reqSecPass = input('Request another password?[y/n]')
if(reqSecPass == 'y' or reqSecPass == 'Y'):
print(another())
else:
print(goodbye())
elif(reqPass == 'computer' or reqPass == 'Computer'):
print('________________')
print('Pass: COMPUTERPASSWORDHERE')
print('________________')
reqSecPass = input('Request another password?[y/n]')
if(reqSecPass == 'y' or reqSecPass == 'Y'):
print(another())
else:
print(goodbye())
elif(reqPass == 'reddit' or reqPass == 'Reddit'):
print('_________________________')
print('User: REDDITUSERNAMEHERE')
print('Pass: REDDITPASSWORDHERE')
print('________________')
reqSecPass = input('Request another password?[y/n]')
if(reqSecPass == 'y' or reqSecPass == 'Y'):
print(request())
else:
print(goodbye())
print('_____This is a password keeper_____')
#checking if the user has an account
actCheck = input('Do you already have an account?')
if(actCheck == 'Yes' or actCheck == 'yes'):
#asking for user's name and password
yourUser = input('___What is your Username?___')
yourPass = input('___What is your Password?___')
if(yourUser == 'ari' and yourPass == 'rycbar1234'):
dirCheck = input('Account settings?[y,n]')
if(dirCheck == 'y' or dirCheck == 'Y'):
print('this function is not working yet!')
actSetCheck = input('Change username or password?')
if(actSetCheck == 'user' or actSetCheck == 'User' or actSetCheck == 'Username' or actSetCheck == 'username'):
yourUser = input('What would you like your new username to be?')
elif(actSetCheck == 'pass' or actSetCheck == 'Pass' or actSetCheck == 'password' or actSetCheck == 'Password'):
yourPass = input('What would you like your new username to be?')
elif(dirCheck == 'n' or dirCheck == 'N'):
print(request())
else:
print('Incorrect Username or password')
Hiçbir şey döndürmemek gibi görünen işlevler, "Hoşçakal" gibi "Yok" u döndürür. Yani, 'Hoşçakal() == Yok'. – 3442
Bir işlevden varsayılan geri dönüş, 'Yok'dur Fonksiyonda yazdırıyorsunuz ve daha sonra işlevi, aramanın etrafında 'print' ile çağırıyorsunuz. – dawg