Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to use float()?

0 votes
asked Dec 30, 2022 by KWOK YEW FUNG Moe (120 points)
Hi, i have a question is, how to use float in python?

2 Answers

0 votes
answered Dec 31, 2022 by Peter Minarik (89,130 points)

Float is a type that can store floating point numbers, i.e. real numbers where you can have an integral part and a fraction part, such as 3.14.

myfloat = 1.234
0 votes
answered Dec 31, 2022 by Apurva Maholiya (180 points)
float is used to input the data in decimal form.eg-1.22,6.5,8,790etc
commented Dec 31, 2022 by Apurva Maholiya (180 points)
in example it is 8.790 .... sorry for my mistake.
commented Jan 1, 2023 by Peter Minarik (89,130 points)
You can edit your previous comments and fix any mistakes. ;)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...