Float' Object Has No Attribute
I Just Started to Learn Python. I Am Getting the Following Error. A=15/737 Print("String Formating with Value{R.1.4F}". Format(R=A)) Attributeerror Traceback...
I just started to learn python. I am getting the following error.
a=15/737
print("String formating with value{r.1.4f}".format(r=a))
AttributeError Traceback (most recent call last) in ---- > 1 print ( "string formating with value {r.1.4f}" . format ( r = a ) )
AttributeError : 'float' object has no attribute '1
Can anyone tell me what is worng here?
1 Answer
It's a just syntax error:
Put a colon (:) behind r instead of a point(.) and it will work.