Note 5.7.1.
A common mistake is to get confused about whether you are providing a variable name or a string literal as an input to the open function. In the code above, βolympics.txtβ is a string literal that should correspond to the name of a file on your computer. If you put something without quotes, like
open(x, "r")
, it will be treated as a variable name. In this example, x should be a variable thatβs already been bound to a string value like βolympics.txtβ.