PY
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
import random
from time import sleep as s
#the countries and fruits were provided by a user in Sololearn
#rules
print("Let's play simple Hangman! I have a list of words from which you will have to guess them correctly.")
s(1)
print("A maximum of x+1 wrong answers are allowed, where x is the number of distinct letters in the word.\nIf you decide to guess the word itself, beware! If you get it wrong, you lose instantly!")
s(1)
#set-up
print("The rest should be easy for you, so here we go!")
s(1)
repeat=""
fruits=[("apple",5),("apricot",8),("avocado",6),("banana",4),("blackcurrant",10),("blueberry",7),("carambola",8),("cherry",6),("coconut",6),("cranberry",8),
("feijoa",7),("fig",4),("gooseberry",8),("grapefruit",10),("grape",6),("melon",6),("kiwi",4),("lemon",6),("lime",5),("mandarin",7),("mango",6),
("nectarine",8),("orange",7),("papaya",4),("peach",6),("pear",5),("pineapple",7),("plum",5),("pomegranate",10),("pummelo",7),("raspberry",8),
("strawberry",9),("tangerine",8),("watermelon",10)] #always will be expanded, all themes
sports=[("soccer",6),("football",7),("baseball",6),("basketball",7),("tennis",6),("hockey",7)]
countries=[("Afghanistan",10),("Albania",7),("Algeria",8),("Andorra",7),("Angola",7),("Anguilla",8),("Antarctica",8),("Argentina",9),("Armenia",8),
("Aruba",6),("Australia",9),("Austria",8),("Azerbaijan",10),("Bahamas",6),("Bahrain",7),("Bangladesh",10),("Barbados",8),("Belarus",8),
("Belgium",8),("Belize",6),("Benin",5),("Bermuda",8),("Bhutan",7),("Bolivia",7),("Botswana",8),("Brazil",7),("Brunei",7),("Bulgaria",8),
("Burundi",7),("Cambodia",8),("Cameroon",8),("Canada",5),("Chad",5),("Chile",6),("China",6),("Columbia",9),("Comoros",6),("Congo",5),
("Croatia",7),("Cuba",5),("Cyprus",7),("Denmark",8),("Djibouti",8),("Dominica",8),("Ecuador",8),("Egypt",6),("Eritrea",7),("Estonia",8),
("Ethiopia",8),("Fiji",4),("Finland",7),("France",7),("Gabon",6),("Gambia",6),("Georgia",8),("Germany",8),("Ghana",5),("Gibraltar",8),
("Greece",5),("Greenland",8),("Grenada",7),("Guadeloupe",9),("Guatemala",8),("Guinea",7),("Guyana",6),("Haiti",5),("Vatican",7),("Honduras",9),
("Hungary",8),("Iceland",8),("India",6),("Indonesia",9),("Iran",5),("Iraq",5),("Ireland",8),("Israel",7),("Italy",6),("Jamaica",6),("Japan",5),
("Jordan",7),("Kazakstan",8),("Kenya",6),("Kiribati",7),("North Korea",10),("South Korea",11),("Kosovo",5),("Kuwait",7),("Kyrgyzstan",10),
("Latvia",6),("Lebanon",7),("Lesotho",7),("Liberia",7),("Liechtenstein",9),("Lithuania",8),("Luxembourg",10),("Macau",5),("Macedonia",9),
("Madagascar",8),("Malaysia",7),("Maldives",9),("Mali",5),("Malta",5),("Martinique",10),("Mauritania",8),("Mexico",7),("Micronesia",10),
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run