What is flagella?

a whip like tail that sprouts at the end of bacteria and it helps bacteria to move in a random way.

The bacterial flagellum is made up of the protein flagellin. Its shape is a 20 nanometer-thick blank tube. It is helical and has a acute bend just outside the outer membrane; this "hook" allows the center of the helix to point directly away from the cell. A shaft runs between the hook and the basal body, passing through protein rings in the cell's membrane that act as bearings. Gram-positive organisms have 2 of these basal body rings, one in the peptidoglycan layer and one in the plasma membrane. Gram-negative organisms have 4 such rings: the L ringassociates with the lipopolysaccharides, the P ring associates with peptidoglycan layer, and the M ring is embedded in the plasma membrane, and the S ring is directly attached to the plasma membrane. The filament ends with a capping protein