Ask your own question, for FREE!
Computer Science 17 Online
kekeman:

Which function in Python converts a natural number into a number with decimal points? float() int() toDecimal() toDouble()

kekeman:

A.)?

Extrinix:

Im not good with python, but I do understand the JavaScript type concepts that are similar to here A natural number is 1,2,3,4,5,6,7,etc. Now, we’re looking for which one of these convert a natural number to a decimal, like this: \(3.0\) To do this, we would need to be using the float() function, and to show it, it would look something like this: value = 7.586 formatString = "{:.2f}".format(value) print(formatString) Which would output: `7.59`

kekeman:

Okay so float()

Extrinix:

@kekeman wrote:
Okay so float()
Yeah

kekeman:

Bet thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!