In addition to above, you can directly use the if condition as show below
if
if 'pythontest' in config[section]
Please refer https://docs.python.org/3/library/configparser.html for different methods with ConfigParser class.