Skip to 0 minutes and 1 secondAbstraction is the art of removing complexity from a problem by hiding background details and information. Let's use abstraction to make our robot wave. To make a robot wave, you could give it the following instructions. Lift your arm, open your hand, move your hand left, move your hand right, move your hand left, move your hand right, close your hand, and lower your arm. Now, that's a lot of instructions to give every time we want to make our robot wave. It would be a lot simpler if we could teach our robot to wave once, and then each time after that, we simply give it the instruction, "wave." Abstraction is a fundamental concept of computing, not just programming.

Skip to 0 minutes and 46 secondsIt's how technology has been able to progress at ever increasing speeds. By continually abstracting problems, the next person who faces the same problem doesn't have to be concerned about the detail. Now, up next, you are going to create functions in Python to simplify and help you reuse code in your programs.

What is abstraction?

Abstraction is the act of removing complexity from a problem by hiding background details and information.

Let’s imagine using abstraction to make our Robot wave.

An animated GIF of a cartoon robot waving, by lifting up its arm, opening its hand, moving its arm left,right,left,right, closing its arms and then lowering its hand.

To make the Robot wave you could give it the following instructions:

lift up your arm
open your hand
move your arm left
move your arm right
move your arm left
move your arm right
close your hand
lower your arm

That would be a lot of instructions to give each time we wanted to make our robot “wave”. It would be much simpler if we could teach our robot how to wave once, and each time after that we could simply give it the instruction wave.

how to wave:
    lift up your arm
    open your hand
    move your arm left
    move your arm right
    move your arm left
    move your arm right
    close your hand
    lower your arm

wave
wave
wave

Abstraction is a fundamental concept of computing (not just programming): it’s how technology has been able to progress at ever increasing speeds by continually abstracting problems, so that the next person who faces the same problem doesn’t have to be concerned about the detail.

You are going to create functions in Python to simplify and reuse code in your programs.

Share this video:

This video is from the free online course:

Programming 101: An Introduction to Python for Educators

Raspberry Pi Foundation