# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# AddField.py
# Calculated.py
# Created on: 2021-05-14 17:20:53.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Set path.
path= "D:\\ArcMap test\\Country.gdb\\"

# Title name amd calculate field name.
country_code = '"KSB"'

FEATURE_LIST = ["Konigsberg_railway","Konigsberg_road"]

for fc in FEATURE_LIST:
     in_features = path + fc

     if arcpy.Exists(in_features):
          arcpy.AddField_management(in_features, "country_code", "TEXT", "", "",  40, "", "NULLABLE")
          arcpy.CalculateField_management(in_features, "country_code", country_code, "PYTHON", "")
          print (fc + " fields are added and updated.")

print ("Finished.")
