x = 4.2
y = 2.0
result = x * y
print(result)
#source code --> clcoding.com
Explanation:
Create Variables:
We define x = 4.2 and y = 2.0.
These are floating-point numbers, meaning they have decimal values (e.g., 4.2, 2.0).
Perform Multiplication:
We multiply x and y using the * operator:
4.2×2.0=8.4
The result (8.4) is stored in the variable result.
Print the Result:
We use print(result) to display the multiplication result.
Output:
8.4
0 Comments:
Post a Comment