-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbirth.py
12 lines (7 loc) · 5.07 KB
/
birth.py
1
2
3
4
5
6
7
8
9
10
11
import random
# Creating a list of countries
num_kst = ["""India""", """China""", """Nigeria""", """Pakistan""", """Indonesia""", """Ethiopia""", """United States""", """Bangladesh""", """DR Congo""", """Egypt""", """Brazil""", """Philippines""", """Mexico""", """Tanzania""", """Uganda""", """Russia""", """Sudan""", """Afghanistan""", """Vietnam""", """Angola""", """Iran""", """Turkey""", """Kenya""", """Iraq""", """Mozambique""", """South Africa""", """Niger""", """Japan""", """Myanmar""", """Algeria""", """Ghana""", """Cameroon""", """Mali""", """Madagascar""", """Yemen""", """United Kingdom""", """Ivory Coast""", """Colombia""", """Malawi""", """Burkina Faso""", """France""", """Zambia""", """Thailand""", """Argentina""", """Chad""", """Germany""", """Morocco""", """Somalia""", """Malaysia""", """Peru""", """Nepal""", """Senegal""", """Uzbekistan""", """Saudi Arabia""", """Venezuela""", """Zimbabwe""", """Italy""", """Burundi""", """Guinea""", """Guatemala""", """Ukraine""", """Benin""", """South Korea""", """Spain""", """South Sudan""", """Rwanda""", """Canada""", """Cambodia""", """Syria""", """North Korea""", """Poland""", """Kazakhstan""", """Sri Lanka""", """Ecuador""", """Australia""", """Sierra Leone""", """Togo""", """Haiti""", """Chile""", """Bolivia""", """Jordan""", """Tajikistan""", """Honduras""", """Papua New Guinea""", """Tunisia""", """Dominican Republic""", """Liberia""", """Taiwan""", """Republic of the Congo""", """Netherlands""", """Laos""", """Central African Republic""", """Romania""", """Israel""", """Azerbaijan""", """Kyrgyzstan""", """Mauritania""", """Belgium""", """Oman""", """Sweden""", """Cuba""", """Paraguay""", """Libya""", """Nicaragua""", """Turkmenistan""", """El Salvador""", """Eritrea""", """Czech Republic""", """United Arab Emirates""",
"""Lebanon""", """Belarus""", """Switzerland""", """Greece""", """Austria""", """Hungary""", """Portugal""", """Kuwait""", """Costa Rica""", """Serbia""", """Panama""", """Guinea-Bissau""", """Namibia""", """Ireland""", """Norway""", """Hong Kong""", """New Zealand""", """Denmark""", """Mongolia""", """Finland""", """Bulgaria""", """Slovakia""", """Lesotho""", """Botswana""", """Singapore""", """Jamaica""", """Georgia""", """Equatorial Guinea""", """Uruguay""", """Moldova""", """Timor-Leste""", """Albania""", """Armenia""", """Croatia""", """Bosnia and Herzegovina""", """Qatar""", """Lithuania""", """Djibouti""", """Bahrain""", """North Macedonia""", """Comoros""", """Slovenia""", """Latvia""", """Trinidad and Tobago""", """Solomon Islands""", """Fiji""", """Mauritius""", """Bhutan""", """Estonia""", """Guyana""", """Cape Verde""", """Belize""", """Suriname""", """Maldives""", """Montenegro""", """Brunei""", """Vanuatu""", """Luxembourg""", """Sao Tome and Principe""", """Macau""", """Iceland""", """Malta""", """New Caledonia""", """French Polynesia""", """Samoa""", """Barbados""", """Guam""", """Kiribati""", """Saint Lucia""", """Tonga""", """Micronesia""", """Grenada""", """Antigua and Barbuda""", """Saint Vincent and the Grenadines""", """Marshall Islands""", """Seychelles""", """Aruba""", """United States Virgin Islands""", """American Samoa""", """Isle of Man""", """Northern Mariana Islands""", """Greenland""", """Cayman Islands""", """Faroe Islands""", """Bermuda""", """Saint Kitts and Nevis""", """Turks and Caicos Islands""", """Andorra""", """Liechtenstein""", """British Virgin Islands""", """San Marino""", """Tuvalu""", """Monaco""", """Nauru""", """Cook Islands""", """Palau""", """Anguilla""", """Montserrat""", """Falkland Islands"""]
# Using random to get a weighted result. The weights are the actual birth rates of each country.
print(random.choices(num_kst, weights=(0.1807, 0.1212, 0.0516, 0.0337, 0.0305, 0.0294, 0.0286, 0.0215, 0.021, 0.0208, 0.0206, 0.018, 0.0164, 0.0151, 0.0139, 0.0108, 0.0107, 0.0104, 0.0103, 0.0103, 0.0103, 0.0091, 0.0086, 0.0086, 0.0084, 0.0083, 0.0076, 0.007, 0.0067, 0.0067, 0.0066, 0.0066, 0.0062, 0.0061, 0.0058, 0.0057, 0.0056, 0.0056, 0.0055, 0.0055, 0.0055, 0.0054, 0.0053, 0.0052, 0.005, 0.005, 0.0045, 0.0045, 0.0043, 0.0041, 0.0039, 0.0039, 0.0039, 0.0038, 0.0037, 0.0036, 0.0036, 0.0035, 0.0034, 0.0031, 0.003, 0.003, 0.003, 0.0029, 0.0029, 0.0027, 0.0027, 0.0026, 0.0026, 0.0026, 0.0024, 0.0023, 0.0022, 0.0022, 0.0021, 0.002, 0.0019, 0.0018, 0.0018, 0.0018, 0.0017, 0.0015, 0.0015, 0.0015, 0.0014, 0.0014, 0.0014, 0.0014, 0.0013, 0.0013,
0.0012, 0.0012, 0.0012, 0.0011, 0.0011, 0.001, 0.001, 0.0009, 0.0009, 0.0009, 0.0008, 0.0008, 0.0008, 0.0008, 0.0008, 0.0007, 0.0007, 0.0007, 0.0007, 0.0007, 0.0007, 0.0006, 0.0006, 0.0006, 0.0006, 0.0006, 0.0006, 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.0005, 0.0004, 0.0004, 0.0004, 0.0004, 0.0004, 0.0004, 0.0004, 0.0004, 0.0004, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), k=4))