The answer to you question is C
Process is the component achieved.
Answer:
True.
Explanation:
When determining the order of magnitude of an algorithm using the Big-Oh algorithm analysis.The instruction which evaluates to O(c) is equal to one that is O(1) because it is considered as constant time and to represent constant we use O(1) in big-Oh notation.
Hence the answer to this question is True.
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.
Answer:
The # marker is used to mark a line comment in python.
Explanation:
The line that starts with # is a comment.Python will ignore the lines that starts with #.These comments can be used to add extra information in the python code.
For example:-
Following is the python code with comments.
names=['sam','optimus','bumblebee'] #names is the list of transformers characters.
for i in names:
print(i) #printing the names.
There are 2 comments in the python code written above.These are ignored by python.