News for hackers. Stuff that matters.
Re:Pattern matching accepted for Python by eljost on Tuesday February 09, 2021 @04:53PM (#26082851)
You can use variables in the formats.

  >>> flt = 1.2345
  >>> two = 2
  >>> f"{flt:.{two}f}"
  '1.23'
Re:Pattern matching accepted for Python by thaumasiotes on Tuesday February 09, 2021 @04:58PM (#26082909)
That is the opposite of the problem being posed. The question is how you define `greet` using f-strings.
Re:Pattern matching accepted for Python by sumzup on Tuesday February 09, 2021 @05:43PM (#26083473)

  greet = lambda x: f"hello {x}"