Ebony C. answered 01/24/23
Current software developer with 4+ years of professional experience
Each of the output lines if the fruit is not found, the print statement is missing an extra space which causes the error. You have the if statements inside of the for loop which is fine but you don't want to check if the fruit is not found and print that each time. Rather you would want to check each item in the inventory and at the end if it is found then return/break and print.
Depending on the required output or desired behavior you want to store or keep track of the fruit found and you can print outside of the loop or you can just print once at the end, outside of the loop, if the count is 1 or is 0. Rather than printing the Fruit_name variable you want to use Fr the loop iterator.