2

I have a python script that ran under python 2 with a variable assignment:

xyz = 1000000000L

Under python 3, this doesn't seem to be recognized ("invalid syntax"). How do I have to change the assignment so that it will run under python 3?

René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293

1 Answers1

2

In Python 3 long was renamed to int, which is now the only built-in integral type. So you need to just omit the L.

Also, if you're fortunate enough to be running Python 3.6+ you can use underscores as visual separators in numeric literals:

xyz = 1_000_000_000
Eugene Yarmash
  • 142,882
  • 41
  • 325
  • 378