Feb-16-2021, 12:04 AM
Your input() method asks for a fruit (line 10).
On line 11, you're comparing the input function against a single space. This will never be true, so execution goes to line 14 and the method exits without doing anything.
I assume you meant to compare it to
If it were any other string, nothing is done and fruit_list remains the same.
Even if you had modified the list, nothing in this script will show the contents. You'd need to print the attribute (or do something with it) to see the results.
On line 11, you're comparing the input function against a single space. This will never be true, so execution goes to line 14 and the method exits without doing anything.
I assume you meant to compare it to
inp
instead of input
. If you did that and the fruit you entered was a single space, it would add that space it to the list (lines 11-12).If it were any other string, nothing is done and fruit_list remains the same.
Even if you had modified the list, nothing in this script will show the contents. You'd need to print the attribute (or do something with it) to see the results.