Python Forum

Full Version: syntax highlighting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

In my Python shell the numvers in the second line are red highlighted. Why are the numbers in the second line highlighted in red? Does this happen for all numbers?

>>>  class MyClass:
    def DoAdd(self, Value1=0, Value2=0):
        Sum = Value1 + Value2
        print("De som van {0} plus {1} is {2}."
              .format(Value1, Value2, Sum))
        
>>> MyInstance = MyClass()
>>> MyInstance.DoAdd(1, 4)
De som van 1 plus 4 is 5.
I ran it on my Linux Mint system without issue (note, however that I corrected indentation,
and added continuation character to line 4 (probably not necessary))
Perhaps it's an OS 'feature'?
>>> class MyClass:
...     def DoAdd(self, Value1=0, Value2=0):
...         Sum = Value1 + Value2
...         print("De som van {0} plus {1} is {2}." \
...             .format(Value1, Value2, Sum))
... 
>>> MyInstance = MyClass()
>>> MyInstance.DoAdd(1, 4)
De som van 1 plus 4 is 5.
>>>
Not red highlighted in Windows 10/64, Python 3.7 or 3.8