When I run the program everything is fine until the password validity function is ran and all the conditions of length and uppercase and lowercase are equal to true. What the program is supposed to do here is run the creditcard function but it doesn't as seen here:
if length and upper and lower == True:
creditcard()
It doesn't give me any errors or syntax messages about it when the conditions of length, upper, and lower case are all true but still will not run the creditcard function, the program simply ends. however when any of the conditions of length uppercase or lowercase are not met using or logic then "The password's invalid" is still successfully printed.
def creditcard():
balence = input("What is your credit card balence this month")
choice = input("Would you like to make a payment or make the standard deduction? y or n")
intrest = .1596/12
amountdue = balence*interest
enter code here
if choice == "y":
payment = input("How much would you like to pay?")
if payment == "n":
if 0.3 * amountdue>25:
payment = 0.3 * amountdue
elif 0.3 * amountdue<25:
payment = 25
balence-=payment
print("Your balence is now", balence)
def validity(password):
length=()
upper=()
lower=()
if len(password)<5:
length = True
else: lenghth = False
for char in password:
if char.isupper():
upper = True
else: upper = False
for char in password:
if char.islower():
lower = True
else: lower = False
if length and upper and lower == True:
creditcard()
if length or upper or lower == False:
print("The password's invalid")
password=""
def main():
password=""
while password=="":
password= input("Please enter a valid password")
validity(password)`enter code here`
main()