Warum bekomme ich hier einen zusätzlichen Platz?Python

Python-Programme
Anonymous
 Warum bekomme ich hier einen zusätzlichen Platz?

Post by Anonymous »

air_temperature = float(input())
print('{:C>.1f}'.format(air_temperature), 'C')
< /code>
Your output: 36.4 C
Expected output 35.4C
< /code>
Error Message
Why am I being told there is an extra space here that is extraneous, and how do I get rid of it?
I am learning about string formatting, and thought I followed the instructions correctly.
I am trying to have only 1 place after the decimal in my float, followed by a C. I have to have the '{}' part in it, and it looks to me to be correct, but is showing that I have an extra space for some reason after the float, before the "C".
What can I try next?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post