#To define a function that take two integers # and return the sum of those two numbers def add(a,b): return a+b #initializing the variables num1 = 10 num2 = 5 #function calling and store the result into sum_of_twonumbers sum_of_twonumbers = add(num1,num2) #To print the result print("Sum of {0} and {1} is {2};" .format(num1, num2, sum_of_twonumbers))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter