Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
int format for 001 - 999
#1
Is there a build it method to do the following?

num = 001

num += 1

print(str(num))
result: 002

currently I get an 'Invalid token' error with 001 as a variable

I'm just looking for a way to count 001, 002 - 999. Rather not reinvent the wheel if something already exists.

Thanks!
Reply


Messages In This Thread
int format for 001 - 999 - by jmair - Feb-06-2019, 09:25 PM
RE: int format for 001 - 999 - by nilamo - Feb-06-2019, 10:26 PM
RE: int format for 001 - 999 - by snippsat - Feb-07-2019, 01:08 AM
RE: int format for 001 - 999 - by scidam - Feb-07-2019, 02:03 AM
RE: int format for 001 - 999 - by jmair - Feb-10-2019, 05:04 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020