Consider the following example to understand better my question:
public class ClassName
{
public ClassName { }
public string Val { get; set; }
...
}
ClassName cn = new ClassName();
cn.Val = "Hi StackOverflow!!";
What would be the equivalent of this code in python?
You can easily add members to any Python object as show in other answers. For more complicated get/set methods like in C#, see the property builtin: