I am super new to python (code in general) I was working on some practice exercises for functions in python 3.
I know it is probably sloppy code and I will work on cleaning it up over my time learning.
def show_employee():
name = input("Employee name: ")
salary = int(input("Employee salary: "))
default = 9000
if salary <= 9000:
return (f'{name}, {default}')
elif len(salary) == 0:
return (f'{name}, {default}')
else:
return (f'{name}, Salary: {salary}')
I continue to receive this error "invalid literal for int() with base 10: '' "
What I am trying to accomplish is simply if the user inputs a number 9000 or less, it returns their name and 9000. If they input anything over 9000, it returns their name and their input value. The part that is puzzling me is how can I get it so that if they do not input a salary value it will default itself to 9000?
Thanks for taking your time to help!