The general recommendation is to avoid stringing parent
attributes like that and instead use a pattern like this: Referencing parents/childern - #2
But going with your approach just for the sake of learning, after the if
statement, what you’d want to do next is just r.text = "stuff"
.
edit: Removed mistaken speculation corrected by @stucork below.