-2

Print air_temperature with 1 decimal point followed by C.

Sample output with input: 36.4158102 36.4C

This is my answer: print('{x:.1f}'C.format(x=air_temperature))

Clifford Attaglo
  • 25
  • 2
  • 2
  • 4

1 Answers1

1

Take a look at this similar question for more on formatting numbers, especially if you're using a version of Python 3 with f-strings (3.6+).

temp = 36.4158102

print('{x:.1f} C'.format(x=temp))

# or

print(f'{temp:.1f} C')  # 3.6+
DomasAquinas
  • 331
  • 1
  • 7