Dremendo Tag Line

Print sum of 3 float numbers in Python

printf() - Question 7

In this question, we will see how to print the sum of 3 float numbers in python programming using the print() function. To know more about print() function click on the print() function lesson.

Q7) Write a program in python to print the sum of 3 float numbers like a=4.5, b=9.0, c=8.63.

Program

a=4.5; b=9.0; c=8.63
print('Sum={:.2f}'.format(a+b+c))

Output

Sum=22.13
video-poster