+ 2
[Python 3.6] Does Solo Learn Code Playground run f'string?
PyCharm suggested me to change print("{} e {}".format(a, b) to print(f"{a} e {b}") Well, I copied the code to SoloLearn and clicked run, but I got an error. Do you know what might have happened?
4 Answers
+ 4
Aha...F-strings were introduced in 3.6; here it's:
import platform
print(platform.python_version())
3.5.1
Here's the official intro +examples:
https://www.python.org/dev/peps/pep-0498
You could request SoloLearn upgrade...
+ 3
format() is supported, but what happened: It depends. What's the error message?
+ 2
Great! Thanks for this hint!
0
When I try to use f-string in Solo Learn, I get the error : Invalid syntaxe
Here is the line
print(f"{a} and {b} are someone's favorite colors.")