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 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz