I am trying to create a code that does not require parameters to determine if one is qualified for a loan, but the function takes years and annual wage into account to determine if qualified. How can I get the function to take inputs without parameters?
edit: I cannot give it parameters becausse that is what was asked of me. To create this function without parameters.
def loan():
"""
-------------------------------------------------------
To qualify for a loan, the annual salary must be 30000 or more and
employee must have worked for a minimum of 5 years
Use: qualified = loan()
-------------------------------------------------------
Returns:
qualified - True if employee qualifies for a loan,
False otherwise (boolean)
-------------------------------------------------------
"""
MIN_SALARY =30000
MIN_YEARS = 5
if years < 5:
qualified = False
elif years >= MIN_YEARS:
if salary >= MIN_SALARY:
qualified = True
else:
qualified = False
else:
qualified = False
return qualified
#--------------Main Program-----------------#
years = int(input('Years employed: '))
salary = float(input('Annual salary: '))
qualified = loan(years = years, salary = salary)
print()
print('Qualified for a loan: {}'.format(qualified))