0

I was making a project and then came across this bit of code, i would like to know what is the meaning of the f'{col:-<50}

.

I have also attached the output of the code, i know that above one is a f statement but am not able to decode it for the specific part.

Ynjxsjmh
  • 28,441
  • 6
  • 34
  • 52

1 Answers1

0

Your code format the value of col (here column name) by alignment with width of 50 characters, padding remaining characters left with -, in another words for nicer formating.

col = 'class'
print ( f'{col:-<50}')
class---------------------------------------------
jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252