Kickstarter is a crowdfunding platform that offers opportunities for its users to financially invest in projects made by others users. The projects available are incredibly varied in terms of its product category ranging from technological innovations to board games. The platform has been around since 2009. Users who can post projects come from various countries, such as United Kingdom, United States, Spain, and even Hong Kong. To date, Kickstarter has managed to raise more than USD 1 billion for over 250,000 projects.
Answer:
import re
def country_capita():
#opens file
file=open("inputfile.txt", "r")
dictionary=dict()
#reads line by line
for line in file.readlines():
# substitutes for multiple space a single space
line = re.sub(r"[\s]{2, }", ' ', line)
list=[]
#splits line on space
list=line.split(" ")
#put into dictionary
dictionary[list[1]]=list[2]
# get input
while True:
choice=input("Enter the country name or quit to exit: ")
if choice=="quit":
break
elif choice in dictionary.keys():
print(dictionary[choice])
else:
print("Invalid Country")
country_capita()
Explanation:
Using python to code this program. First we, (line 1) import the re module which offers us a set of functions that allows us to search a string for a match. ((line 2) Next we define a function country_capita() that will open rawdata_2004.txt, read the information within line by line and create a dictionary list. The we create a while loop with conditional statements that prompt the user to enter country names, print the corresponding values and stops when the user enters quit.
4, 5 , 6 , and plus key
456+