Addition of two numbers in python | Programming with python

Veröffentlicht am: 05 Juli 2020
auf dem Kanal: Programming with python
42
1

Program of addtion of two numbers in python.
code:

Example-1 #

#Addition of two numbers
num1=10
num2=20

#add two numbers

sum=num1+num2

#print the sum

print("the addition of",num1,"and",num2,"is",sum)

example-2 #

#addition of two numbers by using format() function

num1=10
num2=20

#add two numbers

sum=num1+num2

#print the addition

print("sum of {0} and {1} is {2}".format(num1,num2,sum))


Example-3 #


#addition of two numbers provided by user
num1=float(input("Enter the first number"))
num2=float(input("Enter the second number"))

#now, add two numbers
sum=num1+num2

#print the addition
print("the sum of {0} and {1} is {2}:".format(num1,num2,sum))


Like , comment , share and subscribe to channel


Auf dieser Seite können Sie das Online-Video Addition of two numbers in python | Programming with python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Programming with python 05 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 42 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!