a = 2.5
b = 3.5
sum_result = a + b
print(sum_result)
#source code --> clcoding.com
Explanation:
Create Variables:
We define a and b as floating-point numbers (2.5 and 3.5).
A floating-point number is a number with a decimal point (e.g., 2.5, 3.5, 10.75).
Perform Addition:
We add a and b together (2.5 + 3.5).
The result of this addition (6.0) is stored in the variable sum_result.
Print the Result:
We use print(sum_result) to display the sum on the screen.
Output:
6.0
0 Comments:
Post a Comment