Answer:
The function in Python is as follows:
def search_file(filename,mystring):
my_dict = {}
count = 0
file = open(filename)
lines = file.readlines()
for line in lines:
count+=1
if mystring.lower() in line.lower():
my_dict[count] = line.rstrip('\n')
return my_dict
Explanation:
This defines the function
def search_file(filename,mystring):
This initializes an empty dictionary
my_dict = {}
This initializes the number of lines to 0
count = 0
This opens the file
file = open(filename)
This reads the lines of the file
lines = file.readlines()
This iterates through the lines
for line in lines:
This increments the number line
count+=1
This checks if the string exists in the line
if mystring.lower() in line.lower():
If yes, the line number and the string are added to the dictionary
my_dict[count] = line.rstrip('\n')
This returns the dictionary
return my_dict
no longer returns an error but your math seems to have something wrong with it, always returns 0
Console.WriteLine("Enter a percentage here");
int Percent = int.Parse(Console.ReadLine());
Console.WriteLine("Enter your number here");
int Number = int.Parse(Console.ReadLine());
int result = Percent / 100 * Number;
Answer:function of audio programmer
1. The audio programmer at a game development studio works under to integrate sound into the game and write code to manipulate and trigger audio cues like sound effects and background music.
It would be better if we could see the options, fully. But from what I can see, it should be B.