Random Choice from Array with NumPy
📖 Scenario: You are working with a list of fruits in a grocery store. You want to randomly select a fruit to feature as the "Fruit of the Day" on the store's website.
🎯 Goal: Build a small program that uses NumPy to randomly select one fruit from a list of fruits.
📋 What You'll Learn
Create a NumPy array with the exact fruits given
Create a variable to hold the number of fruits
Use NumPy's random choice function to select one fruit randomly
Print the selected fruit
💡 Why This Matters
🌍 Real World
Random selection is useful in many real-world cases like picking a winner in a contest, sampling data, or choosing a random product to promote.
💼 Career
Data scientists often use random sampling to analyze data subsets or to create randomized experiments.
Progress0 / 4 steps