Hello, I am new tocoding

Hello, I am new to programming and I am using python. I have a little problem. below is me trying to use the “try” reserved words but I keep getting a taceback, that there is a problem with my line 4 - dy = float(yz). Can anybody help?

xy = input('Work Hours:')
yz = input('Rate:')
	ds = float(xy)
	dy = float(yz)
	print('Numbers only')
ab = ds*dy
if ds > 40:
	otp = (ds-40) * (dy*0.5)
	mm = ab + otp
	mm = dy*ds

Okay, thank you, It works fine. I just foundout I was using an old file

I’m glad the code worked for you!

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

Thank you, Jeremy. Would make sure to do that the next time

1 Like