MCQs > IT & Programming > Python > To make numbers be of a specific length, zeroes are padded to the left. Which of the following is the best way to pad a string with zeroes to the left, to make its length 5? The string is: num = '123'

Python MCQs

To make numbers be of a specific length, zeroes are padded to the left. Which of the following is the best way to pad a string with zeroes to the left, to make its length 5? The string is: num = '123'

Answer

Correct Answer: print num.zfill(5)

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it