Question: design flowchart for each function to show how each function works. Also, draw flowchart to show how the drive code is designed in terms of
design flowchart for each function to show how each function works. Also, draw flowchart to show how the drive code is designed in terms of how inputs are received, and the functions are called. I will upvote! this is a python code to have an idea of what this code do use this in input file:
Mali,15768000,1240192,fr,Africa Portugal,10477800,92090,pt,Europe New Zealand,4547900,270467,en,Oceania
this is the code: import sys #Function that finds list of all languages and the most spoken language (most spoken language for extra credit) def list_of_all_languages(region, list_of_all_countries_with_data): languages = set() for item in list_of_all_countries_with_data: if item[4] == region: language = item[3] languages.add(language) languages = list(languages) languages.sort() return languages if __name__ == "__main__": file_name = input('What file do you want to parse?: ') # reading data from file file_data_as_list =[] continents = {} try: file_data = open(file_name,"r") list_of_all_lines = file_data.readlines() # converting to list of lists for i in list_of_all_lines: i = i.strip() file_data_as_list.append(i.split(",")) except: print('File not found.') sys.exit(1) for con in file_data_as_list: continents[con[4]]=1 continents = list(continents) continents.sort() for con in continents: print('Name of Continent: '+con) print('Population: ' + str(population_count_for_a_region(con , file_data_as_list))) print('Area: '+ str(area_count_for_a_region(con,file_data_as_list))) print('List of All Languages: ' + str(list_of_all_languages(con,file_data_as_list))) print('Most spoken language: ' + most_frequent(con,file_data_as_list)) print()
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
