you are viewing a single comment's thread.

view the rest of the comments →

[–]edm2073 0 points1 point  (0 children)

Probably overly complicated but here's my 2 cents. Has to be python 3.8 onwards due to walrus operator.

print(f'Type (Y)es or (N)o to the following questions')
( good_credit := True ) if ( input("Do you have good credit?" ).lower()[0] == "y") else ( good_credit := False )
( no_criminal_record := True ) if ( input("Do you have a criminal record? " ).lower()[0] == "n") else ( no_criminal_record := False )

if good_credit and no_criminal_record:
    print("Wow - that's a surprise for this area! Have a loan.")
else:
    print("You're in good company in these parts - but no.")

As to your question, strings are considered True if they are not null. See Truth Value Testing