Let's see how we can add two float numbers in Python using a program.
# Code2care Python Programming:
# Add two float numbers
# in Python
float_number_1 = float(10.97)
float_number_2 = float(11.13)
sum_of_two_float_numbers = float(float_number_1 + float_number_2)
print('Sum: {0} + {1} = {2}'.format(float_number_1, float_number_2, sum_of_two_float_numbers))
PyCharm Output:
/Users/code2care/.local/share/virtualenvs/examples-E9HN9Crc/bin/Python /Users/code2care/PycharmProjects/examples/main.py
Sum: 10.97 + 11.13 = 22.1
Process finished with exit code 0

Python Program add two Floats
- Create a variable float_number_1 that holds the first floating number,
- Create a variable float_number_2 that holds the second floating number,
- Now create a variable sum_of_two_float_numbers that holds the sum of the two numbers.
- Make use of the + Operator to add two floats,
- Print the sum in console using print method.
Have Questions? Post them here!
More Posts related to Python,
- Python: Convert Date to DateTime
- How to sort a List using Lambda in Python
- Python matplotlib segmentation fault: 11 macOS Big Sur
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- How to install Python 3.11 on Mac
- How to flatten a nested list in Python
- Python: Pandas Merge DataFrames on Index Example
- How to Run all Cells at Once Jupyter Notebook
- Python - Convert float to String
- How to add borders to tkinter label text
- How to Exit a Loop in Python Code
- [Python] Fix: ValueError: All arrays must be of the same length
- Sorting an array using Bubble Sort in Python Programming
- How to Unzip a file using Python
- Python: Merge DataFrames Pandas Outer Join Example
- Change label (text) color in tkinter
- Convert Float to String in Python
- Fix: fatal error: No such file or directory compilation terminated
- Python: Access index/counter of a for loop iteration
- Import Other Python Files Examples
- How to install Anaconda on Mac (M1/M2 Mac)
- Python Regular Expression to Find All Matches in List
- How to Read a binary File with Python
- How to disable warnings while Python file execution
- Know current Python Version
More Posts:
- Connect Azure AD (Active Directory) for PowerShell - Powershell
- How to get SharePoint Online user details from person or group column using REST API - SharePoint
- Enable Eclipse dark mode - Eclipse
- Java 20 (JDK) released and here is what is new and deprecated and deleted - Java
- Set Title to Android AlertDialog - Android
- Change label (text) color in tkinter - Python
- How to Change or Set a new Password for your Wi-Fi Router - HowTos
- JavaScript date in yyyy-MM-dd format - JavaScript