How is python3 assigned?

just started learning python3, to write code in atom as follows:
inp = input ("Enter Hours:")
hours = float (" inp")
inp = input ("Enter Rate:")
rate = float (" inp")
print ("rate")
print (" hours")
pay = Rate * Hours
print ("pay")

wants to assign a value to inp, but inp is considered to be string. The running result is
Enter Hours:35
Traceback (most recent call last):
File "assign1.py", line 3, in < module >

hours = float("inp")

ValueError: could not convert string to float: "inp"
what is the problem?
Thank you very much!

Jul.01,2021

the action you expect is float ('35') , and what you actually do is float (' inp') . The
code is changed to hours = float (inp) instead of hours = float ('inp') . The other code below is also modified.


rate = float('inp')
floatinp
Menu