- 1

Question

In math notation, leading zeros are OK, as in 02. What happens if you try this in Python and why?

11th Apr 2020, 11:42 AM
Jamilu Abdullahi Nura
Jamilu Abdullahi Nura - avatar
4 Answers
+ 3
Jamilu Abdullahi Nura Remove shared post first and tell your actual problem.
11th Apr 2020, 11:50 AM
A͢J
A͢J - avatar
+ 2
Jamilu Abdullahi Nura Try to check in Sololearn Playground and search the answer of that error which will come. Btw to add leading zero convert number in String then do concatenation like this print(str(0) + str(5))
11th Apr 2020, 11:59 AM
A͢J
A͢J - avatar
+ 1
Jamilu Abdullahi Nura, please remove all these links from your post: Linking to unrelated material in a question or answer is considered spam! To your question: There's no point asking yourself why the syntax in language x is like this or that. It's a matter of definition. In Python, you can use leading zeros for all numbers except int.
11th Apr 2020, 11:54 AM
HonFu
HonFu - avatar
0
I have this question in my weekly report and I want hint what I should do: "In math notation, leading zeros are OK, as in 02. What happens if you try this in Python and why?"
11th Apr 2020, 11:54 AM
Jamilu Abdullahi Nura
Jamilu Abdullahi Nura - avatar