directory - python raw input delete the zero in the begining? -


I use this code to create a directory with input from the user, but when entering the perfix like 00 or 011 , Then ask for the first inputs: except for numRan = int (raw_input ("how many perfix do you want to start? \" ")): Print" perfix should be a number "sys.exit ()

Any explanation?

The function ignores any leading zeros in the string.

But it seems that you can simply leave inpt as a string in your code:

  inpt = raw_input ("perfix % D: "% (i + 1))  

If you want to allow only numbers, you can use it.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -