Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →How does your email app know a message is spam when nobody wrote a rule for that exact email? It learned from thousands of examples. That idea, software that learns patterns from data and uses them to make decisions, is at the heart of artificial intelligence (AI). This guide explains how that learning works with a tiny runnable example, the main kinds of AI and where their limits are.

There is no single official definition, but a practical one is: AI is a computer system that takes in data, finds patterns in it and uses them to make a decision, prediction or piece of content, often improving as it sees more data.
The idea is older than most people expect. Alan Turing asked "Can machines think?" in his 1950 paper Computing Machinery and Intelligence. John McCarthy and colleagues coined the term "artificial intelligence" in their 1955 proposal for the Dartmouth summer workshop held in 1956 (more in who is the father of AI).
Early AI systems were mostly rule-based: experts wrote "if this, then that" rules. That works for narrow, stable problems, but it breaks down when there are too many cases to write by hand. Nobody can write rules for every way a cat can appear in a photo.
Machine learning flips the approach. You give the computer many examples with the right answers, and an algorithm adjusts the model until its answers match. The model is then used on new data it has not seen.
Suppose we want to flag spam emails using one clue: the number of links. Instead of guessing the cut-off, let the program try every cut-off on labelled examples and keep the one that is right most often.
# Each example: (number of links in the email, label)
emails = [(0, "ham"), (1, "ham"), (2, "ham"), (3, "ham"), (3, "spam"),
(4, "spam"), (5, "spam"), (6, "spam"), (1, "ham"), (7, "spam")]
def accuracy(threshold):
correct = 0
for links, label in emails:
guess = "spam" if links >= threshold else "ham"
correct += guess == label
return correct / len(emails)
for t in range(1, 8):
print(t, accuracy(t))
best = max(range(1, 8), key=accuracy)
print("learned rule: spam if links >=", best)
Output:
1 0.6
2 0.8
3 0.9
4 0.9
5 0.8
6 0.7
7 0.6
learned rule: spam if links >= 3
That is machine learning in miniature: data, a family of possible rules (thresholds 1 to 7), a score (accuracy) and a search for the best rule. Real models use thousands or billions of adjustable numbers instead of one threshold, and many clues instead of one, but the loop is the same. Notice also that no threshold is right every time: the two emails with 3 links have different labels. Real data is messy, and every model makes some errors.
A longer comparison is in types of AI and their capabilities.
| Technique | Idea | Everyday example |
|---|---|---|
| Rule-based / expert systems | Hand-written rules | Simple chat menus, tax calculators |
| Machine learning | Learns patterns from labelled or unlabelled data | Spam filters, credit scoring, product recommendations |
| Deep learning | Machine learning with many-layered neural networks | Face recognition on phones, speech recognition, medical image analysis |
| Generative AI | Deep learning models that produce new text, images, audio or code | ChatGPT, Gemini, Claude, image generators |
These are nested, not separate: generative AI is a kind of deep learning, which is a kind of machine learning, which is one way of building AI. See the difference between machine learning and AI for more detail.
Uncodemy's artificial intelligence course follows a similar order, from Python and machine learning to deep learning and generative AI, with Dedicated Placement Support for learners who finish it.