(May-20-2018, 07:24 AM)wavic Wrote: You have to get a data only from the 'capitals' list if the input country is there. If you put: print(countries) print(capitals) in the alif block, you will see that they are in order.elif line in countries: print(countries) print(capitals)If the input country is in the list 'counties' you get the index of the country in that list and print the capital with the corresponding index in the 'capitals' list.
Yeap I understand all of it.
Indeed they are all in orders.
However, It could not pop the exact answer/output.
Example:
If I type "Malaysia", It came out with "The capital of Russia is Moscow" instead of "The capital of Malaysia is Kuala Lumpur". Although they are inside the list.
Output:No. Countries Capitals
1 Malaysia Kuala Lumpur
2 Japan Tokyo
3 United States of America Washington
4 Canada Ottawa
5 Pakistan Islamabad
6 Australia Canberra
7 Mexico Mexico City
8 Thailand Bangkok
9 Taiwan Taipei
10 China Beijing
11 Czech Republic Prague
12 Russia Moscow
Enter a country name (x to Exit): Malaysia
The capital of Russia is Moscow
Enter a country name (x to Exit): x