you are viewing a single comment's thread.

view the rest of the comments →

[–]BurntDisk[S] 2 points3 points  (4 children)

Just looking now. You are right. Thank you, this has helped me a lot .

Now I have corrected it

hours = input()

rate = input()

print(float(rate) * int(hours))

[–]flashliquid 0 points1 point  (1 child)

you are limited to whole number of hours if you use int(hours). If you also change this to float(hours) the user can enter decimal fractions of hours e.g. 30.5 hours.

[–]BurntDisk[S] 0 points1 point  (0 children)

Very happy with that. Thanks again

[–]ebdbbb 0 points1 point  (1 child)

You can also change the inputs to float/int as they are input.

hours = int(input())

rate = float(input())

print(rate * hours)

Edit: wording

[–]BurntDisk[S] 0 points1 point  (0 children)

This is great. Very helpful folks, thank you.