In short
Sampling is choosing a small group from a larger population to study, so that what you find can fairly describe the whole population.
A good sample is random and large enough. In a random sample, every member of the population has an equal chance of being chosen. A sample that leaves out part of the population, such as a survey made only online, is biased. A larger sample gives a smaller sampling error, but a large biased sample is still wrong.
To find the average height of students in a school of , you could pick students by drawing names from a hat. Measuring only the school's basketball team would give a biased sample.
Python labs run in your browser. Type the code, run it and see what happens.
Open a Python lab