Entering Data from the Keyboard

In this lesson, we will learn about getting data from the user.

Sometimes while we are writing a program, we may want to take input from the user who is actually using our program. We design tasks so that they run on any input that the user may give.

Take the example of a calculator. We put some input into it and tell it what to do with the input. It performs the respective task and displays the result.

Now suppose we are also creating a calculator that performs only addition.

Let’s have a look at an example:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy