How do you syntax a caculation to get the desired output?

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile: h = input(“Hours:”)
r = input(“Rate:”)
o = input(“Overtime:”)
x = input(“Overrate:”)
ph = float(h) * float®
ot = float® * float(x)
op = float(o) * float(x)
pay = float(int(ph) + int(ot) + int(op))
if pay <= 498.75:

Hi, welcome to the Forums!

Can you please format your code by pressing the “</>” button at the top?

Also, what is the link to the exercise you’re working on? Are you trying to define a function?


One thing I can notice is that input("Hours") isn’t stored in any variable-it is just there.


Outside of what has already been mentioned, to my knowledge, this character ® is not one that can be used in python outside of strings. It will result in a syntax error.

As @lisalisaj has already mentioned properly formatting your code is helpful as it preserves indentation, and more details on what you are trying to do specificaly would be helpful.

1 Like

I think the CC forums post formatting does that automatically if you put (r).

1 Like

Ahh, that makes more sense… :man_facepalming:


1 Like

Its early, and apparently my brain isn’t fully functioning yet…

since = sense