-1

Python 3.4 gives error to this statement. This is o print the cartesian product for fuzzy logic operations.

 print(f'The size of the relation will be: {len(self)}x{len(other)}')

I'm trying to perform the union, intersection and difference operations on fuzzy set.

Harshad
  • 1
  • 2

2 Answers2

1

As @hiroprotagonist mentioned in the comments, f-strings were added in Python 3.6. For Python 3.x prior to Python 3.6, do this instead:

print('The size of the relation will be: {0}x{1}'.format(len(self), len(other)))

Or using old-style Python 2 formatting (don't use this if possible):

print('The size of the relation will be: %dx%d' % (len(self), len(other)))
iz_
  • 15,923
  • 3
  • 25
  • 40
0

python 3.4 does not support f-strings You could at emulate them if needed :

def f(s):
    return s.format(**globals())

answer = 'CRICKET'
print(f('FOOTBALL OVER {ans}'))

Edit: Its better to use .format as this wouldn't work directly for len(something)