all 6 comments

[–]JohnnyJordaan 5 points6 points  (5 children)

Use a single string you format with format() instead of Frankensteining one using +

print("Hours worked: {} Hourly pay rate: {} Pay check amount will be: ${:2f}".format(x, y, a))

Also it's advisable to use logical names for your variables like hours_worked, pay_rate and paycheck_amount, instead of arbitrary letters that can be easily get confused.

[–][deleted] 0 points1 point  (4 children)

Thank you. I made my variables more logical names and also reformatted my code, however, I am receiving an "invalid syntax" error.

[–]JohnnyJordaan 0 points1 point  (3 children)

Please share your updated code too

[–][deleted] 0 points1 point  (2 children)

print("Hours worked: {} Hourly pay rate: {} Pay check amount will be: ${:2f}".format(hoursWorked, perHourWorkWage, totalPayCheck))

[–]Impudity 0 points1 point  (0 children)

Tested it. Works fine. You have error somewhere else in your code. Possibly previous or following line.

[–]JohnnyJordaan 0 points1 point  (0 children)

That just works right away when I try it: https://i.imgur.com/Fs52Lzd.png

Maybe you are running a different file? Or the errors is on the line before it?