6.5. R/Python Code