Report Bug

Qus

What will be the output of the following Python function?

float(' -12345\n')

Qusनिम्नलिखित Python फ़ंक्शन का आउटपुट क्या होगा?


A.   -12345.0 (5 blank spaces before the number)
B. -12345.0
C. Error
D. -12345.000000000…. (infinite decimal places)


Solution
B. -12345.0



Explanation
The function float() will remove all the blank spaces and convert the integer to a floating point number. Hence the output will be: -12345.0.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad