(May-13-2020, 07:46 PM)buran Wrote:thank you so much it worked!!==
is equality,=
is assignment. fix it on lines 5 and 7
(May-13-2020, 07:56 PM)deanhystad Wrote: Nested if's are a thing to avoid. For a problem like this it often works best to test for all the bad and if you get past that assume the input is good.Thank you for the advise! Really appreciate it!
if not too_young < age < too_old: print('We don't like babies or or old people') elif salary < 35,000: print('Get a decent job!') elif have_id.lower() != 'y': print('another demeaning remark')Better yet, don't ask further questions if they are already ineligible.
def eligibility(): if input('Do you have a valid license? ').lower() != 'y': print('Sorry, a valid license is required.') return False if int(input('What is your age? ')) > 35: print('Sorry, we only accept applicants 35 or younger') return False # more tests print('Your are eligible') return True