Exercise: IPython

Exercising coding with an IPython notebook.

Now that we know what an IPython notebook is and how it works, let’s relaunch the Python notebook and write a set of instructions to see what the output is.

Python program to add two numbers

Our task is to write a Python program to find the addition of num1 and num2.

Examples:

Input: num1 = 7, num2 = 10
Output: 17

Input: num1 = 23, num2 = 3
Output: 26

Click the “Click to launch app!” button and get started with the exercise.

Please login to launch live app!

We hope that the previous exercise was helpfuld for writing the code.

If not, no need to worry! Here is the Python code for adding two integers.

Press + to interact
# Python3 program to add two numbers
number1 = 7
number2 = 10
# Adding two nos
sum = number1 + number2
# printing values
print("Sum of {0} and {1} is {2}" .format(number1, number2, sum))