I need help on these functions PYTHON 3. The information about
the functions is in the first two pics. 



def read_info_file(filename):
d1={}
info=[]
with open(filename,"r") as f:
f.readline()#reading headers
for line in f:
line=line.replace('"','')
count=line.count(",")
if(count==6):
str=line.split(",")
str[1]=str[1]+","+str[2]
info=[a for a in str if a.count(",")==0]
else:
info=line.split(",")
d1[info[1]]=(int(info[0]),info[2],info[3],int(info[4]),info[5]=="True")
return d1
def read_stats_file(filename):
d2={}
stats=[]
with open(filename,"r") as f:
f.readline()#reading headers
for line in f:
stats=line.split(",")
d2[int(stats[0])]=(int(stats[1]),int(stats[2]),int(stats[3]),int(stats[4]))
return d2
d1=(read_info_file("info.txt"))
d2=(read_stats_file("stats.txt"))
def combine_databases(info_db,stats_db):
finaldict={}
for names in info_db:
for id in stats_db:
a,b,c,d,e=info_db[names]
f,g,h,i=stats_db[id]
if(a==id):
finaldict[names]=(a,b,c,f,g,h,i,d,e)
break
return finaldict
print("info_db :%s "%d1)
print("stats_db :%s"%d2)
print("final_db: %s" % combine_databases(d1,d2))
![read stats file 19 def read_stats_file(filename): 20 21 22 E with open(filename,r) as f: 23 d2-1 stats [] f. readline()#rea](http://img.homeworklib.com/questions/4b7537d0-d3ff-11ea-96c5-bf346deaa7bd.png?x-oss-process=image/resize,w_560)

I need help on these functions PYTHON 3. The information about the functions is in the...
Define the Pokemon class using the given specifications in JavaScript(ES6) Pokemon class specifications The Pokemon class should be defined. A Pokemon object should be initialized, or constructed, by passing in 5 arguments, which should correspond to the following 5 properties in order: .name, .attack, .defense, .health, and .type. For example: const charmander = new Pokemon("charmander", 12, 8, 30, "fire"); console.log(charmander.name); // charmander console.log(charmander.attack); // 12 console.log(charmander.defense); // 8 console.log(charmander.health); // 30 console.log(charmander.type); // fire Data type validation is not needed...
In C++ Instructions Project 2: Gotta Catch ‘Em All Due: July 16 by Midnight For this project you will be designing and implementing a system, in C++, to catalogue Pokémon, their trainers, and the local Pokémon gyms. Your system should act as a database and allow the user to load in multiple tables of data, run basic queries on the data, and then store the data off for later use. Additionally, sample input files will not be uploaded to Canvas,...
PLEASE DO IT IN PYTHON, THANK YOU!
CSV file: This is a file containing plain text where each line in the file represents one record of information, and each piece of info in the record is separated by a single comma. Luckily the values won't ever contain commas themselves for this project. But they might start or end with non visible characters (e.g. space, tab). Thus, you must remove the leading and trailing spaces when you store the data in...
Python 3 Coding Functions:
Here is any code required to help code what is below:
def pokemon_by_types(db, types):
new_db = {}
for pokemon_type in types:
for key in db: # iterate through all the type in types list
if db[key][1] == pokemon_type or db[key][2] == pokemon_type:
if key not in new_db:
new_db[key] = db[key]
return new_db
I need help coding the functions listed below in the image:
Thank you
get types(db): Given a database db, this function determines all the...
Python: def combo(): play = True while play: x = int(input('How many people\'s information would you like to see: ')) print() for num in range(x): name() age() hobby() job() phone() print() answer = input("Would you like to try again?(Enter Yes or No): ").lower() while True: if answer == 'yes': play = True break elif answer == 'no': play = False break else: answer = input('Incorrect option. Type "YES" to try again or "NO" to leave": ').lower()...
PYTHON Hello can someone create the following functions? I'm not sure how to start on them. makeDictionary Define a function named makeDictionary with two parameters. The first argument passed the function must be a list of strings to be used as keys, while the second is a list of the same length containing values (of some type). This function must return a dictionary consisting of the keys paired with the corresponding values. For example, makeDictionary(['apno','value'],['REP-12','450']) must return this dictionary: {'apno':...
Python Help Please! This is a problem that I have been stuck
on.I am only suppose to use the basic python coding principles,
including for loops, if statements, elif statements, lists,
counters, functions, nested statements, .read, .write, while, local
variables or global variables, etc. Thank you! I am using python
3.4.1. ***( The bottom photo is a continuation of the first
one)****
Problem statement For this program, you are to design and implement text search engine, similar to the one...
Help needed with Python 3: Dictionaries and Sets.
The problem is one that asks the user to create a completed
program that prompts the user for the name of a data file, and
reads the contents of that data file, then creates variables in a
form suitable for computing the answer to some questions.
The format should be in the same manner as the attached .py
file. All subsequent assignment details (.py and .csv files) can be
found at this...
1. You will develop a Python program to manage information about baseball players. The program will maintain the following information for each player in the data set: player’s name (string) team identifier (string) games played (integer) at bats (integer) runs scored (integer) hits (integer) doubles (integer) triples (integer) homeruns (integer) batting average (real) slugging percentage (real) The first nine items will be taken from a data file; the last two items will be computed by the program. The following formulas...
Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...