Assignment 2: Python Using Lists and While-Loop

I had an assignment that I was given for Python. What I have to do is to write a program in Python that asks a user to enter their favourite fruit, store each fruit in a list. At the end of the program, print out the total number of fruits, and also print all the fruits. This is what I’m expected: What is your favourite fruit? Banana (the fruit user put) What is your favourite fruit? Apple (the fruit user put) What is your favourite fruit? Orange (the fruit user put) What is your favourite fruit? (empty) (the user didn't write anything) You have 3 fruits in the basket: Banana, Apple, and Orange. So how do I do this? ...

October 7, 2023 · 5 min · SourFox