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?
11 Answer
It's a just syntax error:
Put a colon (:) behind r instead of a point(.) and it will work.