'String Formatting Error in Python Challenge Even Though It's Correct in IDE

I was solving some Python challenges on Edabit and I encountered this question. I believe that my code is ok and also tested in PyCharm, which gave me the expected result.

Why string formatting gives me the Syntax Error on Edabit challenges even though it is correct?enter image description here



Solution 1:[1]

For Python versions before 3.6 you won't have available the currently preferred f-strings. Up to Python 3.6 you could use str.format().

Example for this:

def example_dothat(lst):
    RTotal = round(sum(lst), 1)
    print("{} ohms".format(RTotal)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 aaossa