guerfi rabah
last year
Guerficountry asked

In Python f-strings, what is the difference between f and F in print(f"message")?

Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi guerfi,

There is no difference. f"..." and F"..." both mean an f-string, and they work the same.

Example:

name = "Alice"
print(f"Hi {name}")
print(F"Hi {name}")

Both print the same output.

If you have more questions, I am here to help 😊

Python
This question was asked as part of the Getting started with Python course.