Python Forum
can a number preceed a line of code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can a number preceed a line of code?
#2
(May-07-2024, 05:40 AM)Skaperen Wrote: is there any case where a line of code that begins with a decimal number expressed as a run of digit characters can be valid Python code in Python3?
These lines are valid python code if that's what you mean
232444
7663 + 12333
87633 >> x
Does your preprocessor remove these lines?
>>> class A:
...     def __rrshift__(self, n):
...         print('Hello', n)
... 
>>> a = A()
>>> 1876 >> a
Hello 1876
« We can solve any problem by introducing an extra level of indirection »
Reply


Messages In This Thread
can a number preceed a line of code? - by Skaperen - May-07-2024, 05:40 AM
RE: can a number preceed a line of code? - by Gribouillis - May-07-2024, 05:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  code style - one line subclause on same line Skaperen 5 5,006 Nov-29-2017, 01:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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