Aug-02-2020, 03:02 PM
(This post was last modified: Aug-02-2020, 03:02 PM by Python_User.)
Ok, this is a bounce of information and difficult to understand.
- Why isn't the
- What is the function of "f" in
- What is the curly brackets function in
- How knows python to refer to the question mark?? This is really difficult to understand for me at the moment...
Maybe the questions are dumb, but I am trying to understand it properly.
class Doubleup: classvar = 'Hello' classvar = 'Goodbye' def __init__(self): self.punctuation = ',' self.punctuation = '!' def __init__(self): self.punctuation = ';' self.punctuation = '?' def message(self): return f'Hello world{self.punctuation}' def message(self): return f'Goodbye world{self.punctuation}' print(Doubleup().message())From the code above:
- Why isn't the
puntuaction
defined as argument in the methods?- What is the function of "f" in
return f'Goodbye world{self.punctuation}'
?- What is the curly brackets function in
return f'Goodbye world{self.punctuation}'
?- How knows python to refer to the question mark?? This is really difficult to understand for me at the moment...
Maybe the questions are dumb, but I am trying to understand it properly.