Hi there,
i'm new to coding/python and keep getting a syntax error.
This gives me a syntax error:
print( 'Forced order:\t' , c, '%'(, a, '+', b,) '=', c % ( a + b ) )
Can anyone see where I went wrong but also explain why it is wrong please.
Many thanks

I find that basically all the time a syntax error is misplaced commas or brackets.
print('Forced order:\t', c, '%', (a, '+', b), '=', c, '%', ( a + b ))
I don't know if that is exactly what you want, but it's close. Just triple check the commas, etc. Think of "Syntax error" as a fancy word for "type-o".
Your problem with commas clearly illustrates advantages of f-strings (3.6 <= Python) or .format method. Using placeholders makes writing much easier:
>>> a = 4
>>> b = 2
>>> f'{a}+{b}={a+b} and {str(a) + str(b)} is meaning of life'
'4+2=6 and 42 is meaning of life'
Figured it out. It was the single quotes(') next to the (%) and (=) signs I had in the wrong place.
This is what it should look like (which returned no errors) :
print( 'Forced order:\t' , c, '% (', a, '+', b, ') =', c % ( a + b ) )
as opposed to this which is incorrect:
print( 'Forced order:\t' , c, '%'[error][/error](, a, '+', b,) '='[error][/error], c % ( a + b ) )
@
perfringo - you make a good point with placeholders but I'm going through the python in easy steps books which doesn't go through placeholder until later.
Many thanks to both of you for your replies guys.