how does machine learning learn code example

Example 1: what is machine learning

When a Machine automatically for a particular kind of problem redefines its
solution based on the data acquired from past experiences, this process is
known as Machine Learning.

Types of ML :
 -Supervised Learning
 -UnSupervised Learning
 -Reinforcement Learning

Example 2: machine learnig

example of machine leaning is like medical diagnosis, image processing, 
 prediction, classification, learning association, regression etc. 
 The intelligent systems built on machine learning algorithms have the 
 capability to learn from past experience or 
 historical data.