Python 3.8 Tutorial

Functions in Python

The very basics of Functions in Python and how they work.

sum_of_two_numbes.pyx=4y=3sum = x + yprint(sum)//7
python program to add two numbes
def add_two_numbers(n):   for i in range(1,n+1):        x = int(input('enter value for x: '))        y = int(input('enter value for x: '))        sum_of_two = x + y        print ('sum of two numbers are: ',sum_of_two)        return 'program ends :)'
n = int(input('how many times: '))print(add_two_numbers(n))
The output of the program

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saranjeet Singh

I write tutorials on Python, JavaScript, React, and Django. I write for InPlainEnglish and TheStartUp .