pycountry: pycountry.countries Example

Syntax

pycountry.countries

pycountry.countries Example

import pycountry

# countries
countries = pycountry.countries

for country in countries:
    # Country's name
    print(country.name)
    # Country's Code
    print(country.alpha_3)

Output:

Sudan
SDN
Senegal
SEN
Singapore
SGP
South Georgia and the South Sandwich Islands
SGS
Saint Helena, Ascension and Tristan da Cunha
SHN
Svalbard and Jan Mayen
SJM
Solomon Islands
SLB
Sierra Leone
SLE
El Salvador
SLV
San Marino
SMR
Somalia
SOM
Saint Pierre and Miquelon
SPM
Serbia
SRB
South Sudan
SSD
Sao Tome and Principe
STP
Suriname
SUR
Slovakia
SVK
Slovenia
SVN
Sweden
SWE
Eswatini
SWZ
Sint Maarten (Dutch part)
SXM
Seychelles
SYC
Syrian Arab Republic
SYR
Turks and Caicos Islands
TCA
Chad
TCD
Togo
TGO
Thailand
THA
Tajikistan
TJK
Tokelau
TKL
Turkmenistan
TKM
Timor-Leste
TLS
Tonga
TON
Trinidad and Tobago
TTO
Tunisia
TUN
Turkey
TUR
Tuvalu
TUV
Taiwan, Province of China
TWN
Tanzania, United Republic of
TZA
Uganda
UGA
Ukraine
UKR
United States Minor Outlying Islands
UMI
Uruguay
URY
United States
USA
Uzbekistan
UZB
Holy See (Vatican City State)
VAT
Saint Vincent and the Grenadines
VCT
Venezuela, Bolivarian Republic of
VEN
Virgin Islands, British
VGB
Virgin Islands, U.S.
VIR
Viet Nam
VNM
Vanuatu
VUT
Wallis and Futuna
WLF
Samoa
WSM
Yemen
YEM
South Africa
ZAF
Zambia
ZMB
Zimbabwe
ZWE