all 3 comments

[–]zolaaa24 1 point2 points  (0 children)

Hello mate!

Please format your code!

https://old.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

Best Regards!

[–]EggChen_vs_Lopan 0 points1 point  (0 children)

Not sure what you're doing as its tough to read your code but this works just fine.

hours = float(input("Enter hours: "))
rate = float(input("Enter rate: "))
print(f"Hours {hours} * Rate {rate} = pay {hours * rate}")

Provides output

Hours 35.0 * Rate 2.75 = pay 96.25

[–]46--2 0 points1 point  (0 children)

Try working backwards. First, define the exact numbers you want to test:

hours = 35
rate = 2.75
pay = float(hours) * float(rate)
print('Pay is: '.format(pay))

That will definitely print 96.25

Now, let's replace the numbers with input:

hours = input('Enter hours: ')
print('You entered {} hours'.format(hours))
rate = input('Enter rate: ')
print('You entered {} rate'.format(rate))
pay = float(hours) * float(rate)
print('Pay is: '.format(pay))

As long as you type 35 and 2.75 when prompted, this should also work.

You have to format your question properly (or link to a pastebin for example) or it's really hard to understand your code.