-
Notifications
You must be signed in to change notification settings - Fork 0
/
v3.py
36 lines (35 loc) · 5.59 KB
/
v3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#print("enter the name of the starting country or capital")
#a=input()
#print("enter the count limit")
#countlimit=int(input())
for j in range(65,91):
countries=['AFGHANISTAN', 'ALBANIA', 'ALGERIA', 'ANDORRA', 'ANGOLA', 'ANTIGUA & BARBUDA', 'ARGENTINA', 'ARMENIA', 'AUSTRALIA', 'AUSTRIA', 'AZERBAIJAN', 'BAHAMAS, THE', 'BAHRAIN', 'BANGLADESH', 'BARBADOS', 'BELARUS', 'BELGIUM', 'BELIZE', 'BENIN', 'BHUTAN', 'BOLIVIA', 'BOSNIA & HERZEGOVINA', 'BOTSWANA', 'BRAZIL', 'BRUNEI', 'BULGARIA', 'BURKINA FASO', 'BURUNDI', 'CABO VERDE', 'CAMBODIA', 'CAMEROON', 'CANADA', 'CENTRAL AFRICAN REPUBLIC', 'CHAD', 'CHILE', 'CHINA', 'COLOMBIA', 'COMOROS', 'CONGO, DEMOCRATIC REPUBLIC OF THE', 'COSTA RICA', "CÔTE D'IVOIRE", 'CROATIA', 'CUBA', 'CYPRUS', 'CZECH REPUBLIC', 'DENMARK', 'DJIBOUTI', 'DOMINICA', 'DOMINICAN REPUBLIC', 'ECUADOR', 'EGYPT', 'EL SALVADOR', 'EQUATORIAL GUINEA', 'ERITREA', 'ESTONIA', 'ESWATINI', 'ETHIOPIA', 'FEDERATED STATES OF MICRONESIA', 'FIJI', 'FINLAND', 'FRANCE', 'GABON', 'GAMBIA, THE', 'GEORGIA', 'GERMANY', 'GHANA', 'GREECE', 'GRENADA', 'GUATEMALA', 'GUINEA', 'GUINEA-BISSAU', 'GUYANA', 'HAITI', 'HONDURAS', 'HUNGARY', 'ICELAND', 'INDIA', 'INDONESIA', 'IRAN', 'IRAQ', 'IRELAND', 'ISRAEL', 'ITALY', 'JAMAICA', 'JAPAN', 'JORDAN', 'KAZAKHSTAN', 'KENYA', 'KIRIBATI', 'KOSOVO', 'KUWAIT', 'KYRGYZSTAN', 'LAOS', 'LATVIA', 'LEBANON', 'LESOTHO', 'LIBERIA', 'LIBYA', 'LIECHTENSTEIN', 'LITHUANIA', 'LUXEMBOURG', 'MACEDONIA', 'MADAGASCAR', 'MALAWI', 'MALAYSIA', 'MALDIVES', 'MALI', 'MALTA', 'MARSHALL ISLANDS', 'MAURITANIA', 'MAURITIUS', 'MEXICO', 'MOLDOVA', 'MONACO', 'MONGOLIA', 'MONTENEGRO', 'MOROCCO', 'MOZAMBIQUE', 'MYANMAR', 'NAMIBIA', 'NAURU', 'NEPAL', 'NETHERLANDS', 'NEW ZEALAND', 'NICARAGUA', 'NIGER', 'NIGERIA', 'NORTH KOREA', 'NORWAY', 'OMAN', 'PAKISTAN', 'PALAU', 'PALESTINE', 'PANAMA', 'PAPUA NEW GUINEA', 'PARAGUAY', 'PERU', 'PHILIPPINES', 'POLAND', 'PORTUGAL', 'QATAR', 'REPUBLIC OF THE CONGO', 'ROMANIA', 'RUSSIA', 'RWANDA', 'SAINT KITTS & NEVIS', 'SAINT LUCIA', 'SAINT VINCENT & THE GRENADINES', 'SAMOA', 'SAN MARINO', 'SÃO TOMÉ & PRÍNCIPE', 'SAUDI ARABIA', 'SENEGAL', 'SERBIA', 'SEYCHELLES', 'SIERRA LEONE', 'SINGAPORE', 'SLOVAKIA', 'SLOVENIA', 'SOLOMON ISLANDS', 'SOMALIA', 'SOUTH AFRICA', 'SOUTH KOREA', 'SOUTH SUDAN', 'SPAIN', 'SRI LANKA', 'SUDAN', 'SURINAME', 'SWEDEN', 'SWITZERLAND', 'SYRIA', 'TAJIKISTAN', 'TANZANIA', 'THAILAND', 'TIMOR-LESTE', 'TOGO', 'TONGA', 'TRINIDAD & TOBAGO', 'TUNISIA', 'TURKEY', 'TURKMENISTAN', 'TUVALU', 'UGANDA', 'UKRAINE', 'UNITED ARAB EMIRATES', 'UNITED KINGDOM', 'UNITED STATES', 'URUGUAY', 'UZBEKISTAN', 'VANUATU', 'VATICAN CITY', 'VENEZUELA', 'VIETNAM', 'YEMEN']
capitals=['KABUL', 'TIRANA', 'ALGIERS', 'ANDORRA LA VELLA', 'LUANDA', "SAINT JOHN'S", 'BUENOS AIRES', 'YEREVAN', 'CANBERRA', 'VIENNA', 'BAKU', 'NASSAU', 'MANAMA', 'DHAKA', 'BRIDGETOWN', 'MINSK', 'BRUSSELS', 'BELMOPAN', 'PORTO-NOVO', 'THIMPHU', 'SUCRE', 'SARAJEVO', 'GABORONE', 'BRASILIA', 'BANDAR SERI BEGAWAN', 'SOFIA', 'OUAGADOUGOU', 'BUJUMBURA', 'PRAIA', 'PHNOM PENH', 'YAOUNDE', 'OTTAWA', 'BANGUI', "N'DJAMENA", 'SANTIAGO', 'BEIJING', 'BOGOTÁ', 'MORONI', 'KINSHASA', 'SAN JOSE', 'YAMOUSSOUKRO', 'ZAGREB', 'HAVANA', 'NICOSIA', 'PRAGUE', 'COPENHAGEN', 'DJIBOUTI (CITY)', 'ROSEAU', 'SANTO DOMINGO', 'QUITO', 'CAIRO', 'SAN SALVADOR', 'MALABO', 'ASMARA', 'TALLINN', 'MBABANE', 'ADDIS ABABA', 'PALIKIR', 'SUVA', 'HELSINKI', 'PARIS', 'LIBREVILLE', 'BANJUL', 'TBILISI', 'BERLIN', 'ACCRA', 'ATHENS', "SAINT GEORGE'S", 'GUATEMALA CITY', 'CONAKRY', 'BISSAU', 'GEORGETOWN', 'PORT-AU-PRINCE', 'TEGUCIGALPA', 'BUDAPEST', 'REYKJAVIK', 'NEW DELHI', 'JAKARTA', 'TEHRAN', 'BAGHDAD', 'DUBLIN', 'JERUSALEM, TEL AVIV', 'ROME', 'KINGSTON', 'TOKYO', 'AMMAN', 'ASTANA', 'NAIROBI', 'SOUTH TARAWA', 'PRISTINA', 'KUWAIT CITY', 'BISHKEK', 'VIENTIANE', 'RIGA', 'BEIRUT', 'MASERU', 'MONROVIA', 'TRIPOLI', 'VADUZ', 'VILNIUS', 'LUXEMBOURG', 'SKOPJE', 'ANTANANARIVO', 'LILONGWE', 'KUALA LUMPUR', 'MALE', 'BAMAKO', 'VALLETTA', 'MAJURO', 'NOUAKCHOTT', 'PORT LOUIS', 'MEXICO CITY', 'CHISINAU', 'MONACO', 'ULAANBAATAR', 'PODGORICA', 'RABAT', 'MAPUTO', 'NAY PYI TAW', 'WINDHOEK', 'YAREN DISTRICT', 'KATHMANDU', 'AMSTERDAM', 'WELLINGTON', 'MANAGUA', 'NIAMEY', 'ABUJA', 'PYONGYANG', 'OSLO', 'MUSCAT', 'ISLAMABAD', 'NGERULMUD', 'JERUSALEM, RAMALLAH', 'PANAMA CITY', 'PORT MORESBY', 'ASUNCIÓN', 'LIMA', 'MANILA', 'WARSAW', 'LISBON', 'DOHA', 'BRAZZAVILLE', 'BUCHAREST', 'MOSCOW', 'KIGALI', 'BASSETERRE', 'CASTRIES', 'KINGSTOWN', 'APIA', 'SAN MARINO', 'SÃO TOMÉ', 'RIYADH', 'DAKAR', 'BELGRADE', 'VICTORIA', 'FREETOWN', 'SINGAPORE', 'BRATISLAVA', 'LJUBLJANA', 'HONIARA', 'MOGADISHU', 'BLOEMFONTEIN, CAPE TOWN, PRETORIA', 'SEOUL', 'JUBA', 'MADRID', 'COLOMBO, SRI JAYAWARDENEPURA KOTTE', 'KHARTOUM', 'PARAMARIBO', 'STOCKHOLM', 'BERN', 'DAMASCUS', 'DUSHANBE', 'DODOMA', 'BANGKOK', 'DILI', 'LOMÉ', 'NUKUʻALOFA', 'PORT OF SPAIN', 'TUNIS', 'ANKARA', 'ASHGABAT', 'FUNAFUTI', 'KAMPALA', 'KIEV', 'ABU DHABI', 'LONDON', 'WASHINGTON, D.C.', 'MONTEVIDEO', 'TASHKENT', 'PORT VILA', 'VATICAN CITY', 'CARACAS', 'HANOI', "SANA'A", 'LUSAKA', 'HARARE']
a=chr(j)
a=a.upper()
k=a[-1]
count=0
flag=0
while(flag==0):
flag=1
for i in countries:
if(i.startswith(k)):
k=i[-1]
count=count+1
countries.remove(i)
flag=0
break
if(flag):
for i in capitals:
if(i.startswith(k)):
k=i[-1]
count=count+1
capitals.remove(i)
flag=0
break
if(flag):
print("no element found")
break
print(a,end="")
print(count)
input()