change C to Python