Nov-18-2023, 06:23 PM
hi
I wrote the below code in vs code and it took an error in line 7 but in idle the code ran okay:
to change to
what is the difference between !== and is not?
thanks
I wrote the below code in vs code and it took an error in line 7 but in idle the code ran okay:
'''a test for regex ''' import re REGEX = r"(?im:foo),\w+" m = re.search(REGEX, 'FOo,bar_baz') if m is not None: # i first had written m != None, # Comparison 'm != None' should be 'm is not None' print(f'm.group(0): {m.group(0)}') else: print(f'result of match is: {m}')in line 7 as you can see, I first wrote
m!==Noneand vs code took an error and suggested to me
to change to
m is not None.
what is the difference between !== and is not?
thanks