#Using Trinket to print an F-String, but F-String isn't working and there is an error when I try it

3 messages · Page 1 of 1 (latest)

cedar sierra
#
ten = 10.0025
print(f'{round(10, 2)}')

you need the f outside the fstring, and inside the {} inside an f-string, the code must be valid

cedar sierra
#

print(f'{ten: .2f}') should work too, yes

#

strange.. maybe trinket ide is using an older version of python?