im really confused on this assignment i have all the files but Im not sure how im supposed to store them on my computer to make the program run. the teacher provided us a partially written program for us to complete. I complicated code but it doesnt work it has an error that says unintended does not match. bellow are the assignment instructions and the un finished code as well as the one i wrote.
instructions:
Some scholars believe you can learn a great deal about an author by studying his or her use of pronouns. we will use a dictionary to count the pronouns in gb.txt. Complete the functions in the program in order to count the number of times each pronoun occurs in gb.txt. Complete the function show_counts() to print the number of times each pronoun occurs. For full credit, print the pronouns in alphabetical order and only print the ones that have a count greater than 0.
unfinished code:
import string #To get punctuation characters
def readfile(fname):
”’Return contents of a text file as a lower-case string”’
pass #You can take this out or leave it – it doesn’t matter
#Open the file for reading
#Read the contents of the file as one long string
#Close the file
#Use string.punctuation to remove punctuation
#Return the string (converting it to lower case)
def count_pronouns(word_list, pronoun_list):
”’Returns a dictionary with words and their counts
word_list is a list of words from the text file
pronoun_list is a list of English pronouns”’
pass #You can take this out or leave it
#You are given two lists – you don’t have to split the text
#If you want to see what word_list and…
#…pronoun_list look like you can print them here
#Start with an empty dictionary
#For each word in word_list
# If the word is a pronoun then
# If the word is not in the dictionary
# Add it with a count of 1
# Otherwise,
# Add one to that word’s count
#Return the dictionary
def show_counts(pronoun_dict):
”’Print prounouns and their counts; print only those with counts > 0
pronoun_dict is the dictionary of pronouns with their counts”’
pass #You can take this out
#Get a list of the keys
#Sort the list of keys
#For each key in the key list
#If the count is greater than 0
# Print the key and the count
#Don’t return anything
#Don’t change anything below this point
def main():
text_filename = ‘Data//gb.txt’ #Count pronouns in this file
pronoun_filename = ‘Data//pronouns.txt’ #List of pronouns
gb = readfile(text_filename) #gb is the contents of the text file (a string)
gb_words = gb.split() #Split file contents into a list of words
pronouns = readfile(pronoun_filename)
pronoun_list = pronouns.split()
pronoun_dict = count_pronouns(gb_words, pronoun_list)
show_counts(pronoun_dict)
main()
my code:
import string #To get punctuation characters
def readfile(fname):
”’Return contents of a text file as a lower-case string”’
f = open(fname,’r’) #Open the file for reading
contents = f.read() #Read the contents of the file as one long string
f.close() #Close the file
for char in string.punctuation: #Use string.punctuation to remove punctuation
contents = contents.replace(char, ”)
return contents.lower() #Return the string (converting it to lower case)
def count_pronouns(word_list, pronoun_list):
”’Returns a dictionary with words and their counts
word_list is a list of words from the text file
pronoun_list is a list of English pronouns”’
word_count = {} #Start with an empty dictionary
for word in word_list: #For each word in word_list
if word in pronoun_list: #If the word is a pronoun then
if word not in word_count: #If the word is not in the dictionary
word_count[word] = 1 #Add it with a count of 1
else: #Otherwise,
word_count[word] += 1 #Add one to that word’s count
return word_count #Return the dictionary
def show_counts(pronoun_dict):
”’Print prounouns and their counts; print only those with counts > 0
pronoun_dict is the dictionary of pronouns with their counts”’
key_list = list(pronoun_dict.keys()) #Get a list of the keys
key_list = key_list.sort() #Sort the list of keys
for word in word_list: #For each key in the key list
if pronoun_dict[word] > 0: #If the count is greater than 0
print(word, pronoun_dict[word]): #Print the key and the count
#Don’t return anything
#Don’t change anything below this point
def main():
text_filename = ‘Data//gb.txt’ #Count pronouns in this file
pronoun_filename = ‘Data//pronouns.txt’ #List of pronouns
gb = readfile(text_filename) #gb is the contents of the text file (a string)
gb_words = gb.split() #Split file contents into a list of words
pronouns = readfile(pronoun_filename)
pronoun_list = pronouns.split()
pronoun_dict = count_pronouns(gb_words, pronoun_list)
show_counts(pronoun_dict)
main()
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Really Confused On This Assignment I Have All The Files But Im Not Sure How I
/in Uncategorized /by developerim really confused on this assignment i have all the files but Im not sure how im supposed to store them on my computer to make the program run. the teacher provided us a partially written program for us to complete. I complicated code but it doesnt work it has an error that says unintended does not match. bellow are the assignment instructions and the un finished code as well as the one i wrote.
instructions:
Some scholars believe you can learn a great deal about an author by studying his or her use of pronouns. we will use a dictionary to count the pronouns in gb.txt. Complete the functions in the program in order to count the number of times each pronoun occurs in gb.txt. Complete the function show_counts() to print the number of times each pronoun occurs. For full credit, print the pronouns in alphabetical order and only print the ones that have a count greater than 0.
unfinished code:
import string #To get punctuation characters
def readfile(fname):
”’Return contents of a text file as a lower-case string”’
pass #You can take this out or leave it – it doesn’t matter
#Open the file for reading
#Read the contents of the file as one long string
#Close the file
#Use string.punctuation to remove punctuation
#Return the string (converting it to lower case)
def count_pronouns(word_list, pronoun_list):
”’Returns a dictionary with words and their counts
word_list is a list of words from the text file
pronoun_list is a list of English pronouns”’
pass #You can take this out or leave it
#You are given two lists – you don’t have to split the text
#If you want to see what word_list and…
#…pronoun_list look like you can print them here
#Start with an empty dictionary
#For each word in word_list
# If the word is a pronoun then
# If the word is not in the dictionary
# Add it with a count of 1
# Otherwise,
# Add one to that word’s count
#Return the dictionary
def show_counts(pronoun_dict):
”’Print prounouns and their counts; print only those with counts > 0
pronoun_dict is the dictionary of pronouns with their counts”’
pass #You can take this out
#Get a list of the keys
#Sort the list of keys
#For each key in the key list
#If the count is greater than 0
# Print the key and the count
#Don’t return anything
#Don’t change anything below this point
def main():
text_filename = ‘Data//gb.txt’ #Count pronouns in this file
pronoun_filename = ‘Data//pronouns.txt’ #List of pronouns
gb = readfile(text_filename) #gb is the contents of the text file (a string)
gb_words = gb.split() #Split file contents into a list of words
pronouns = readfile(pronoun_filename)
pronoun_list = pronouns.split()
pronoun_dict = count_pronouns(gb_words, pronoun_list)
show_counts(pronoun_dict)
main()
my code:
import string #To get punctuation characters
def readfile(fname):
”’Return contents of a text file as a lower-case string”’
f = open(fname,’r’) #Open the file for reading
contents = f.read() #Read the contents of the file as one long string
f.close() #Close the file
for char in string.punctuation: #Use string.punctuation to remove punctuation
contents = contents.replace(char, ”)
return contents.lower() #Return the string (converting it to lower case)
def count_pronouns(word_list, pronoun_list):
”’Returns a dictionary with words and their counts
word_list is a list of words from the text file
pronoun_list is a list of English pronouns”’
word_count = {} #Start with an empty dictionary
for word in word_list: #For each word in word_list
if word in pronoun_list: #If the word is a pronoun then
if word not in word_count: #If the word is not in the dictionary
word_count[word] = 1 #Add it with a count of 1
else: #Otherwise,
word_count[word] += 1 #Add one to that word’s count
return word_count #Return the dictionary
def show_counts(pronoun_dict):
”’Print prounouns and their counts; print only those with counts > 0
pronoun_dict is the dictionary of pronouns with their counts”’
key_list = list(pronoun_dict.keys()) #Get a list of the keys
key_list = key_list.sort() #Sort the list of keys
for word in word_list: #For each key in the key list
if pronoun_dict[word] > 0: #If the count is greater than 0
print(word, pronoun_dict[word]): #Print the key and the count
#Don’t return anything
#Don’t change anything below this point
def main():
text_filename = ‘Data//gb.txt’ #Count pronouns in this file
pronoun_filename = ‘Data//pronouns.txt’ #List of pronouns
gb = readfile(text_filename) #gb is the contents of the text file (a string)
gb_words = gb.split() #Split file contents into a list of words
pronouns = readfile(pronoun_filename)
pronoun_list = pronouns.split()
pronoun_dict = count_pronouns(gb_words, pronoun_list)
show_counts(pronoun_dict)
main()
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Struggling With This Question For Critical Reasoning Is There Any Way You Cou
/in Uncategorized /by developerIm struggling with this question for critical reasoning. Is there any way you could help me?
The following are two passages from Florence Nightingale’s Notes on Nursing:
Passage 1
Now the medical man who sees the patient only once a day or even only once or twice a week, cannot possibly tell this without the assistance of the patient himself, or of those who are in constant observation on the patient. The utmost the medical man can tell is whether the patient is weaker or stronger at this visit than he was at the last visit. I should therefore say that incomparably the most important office of the nurse, after she has taken care of the patient’s air, is to take care to observe the effect of his food, and report it to the medical attendant. (1860, Section VII, para.14)
Passage 2
To be “in charge” is certainly not only to carry out the proper measures yourself but to see that everyone else does so too; to see that no one either willfully or ignorantly thwarts or prevents such measures. It is neither to do everything yourself nor to appoint a number of people to each duty, but to ensure that each does that duty to which he is appointed. This is the meaning which must be attached to the word by (above all) those “in charge” of sick, whether of numbers or of individuals. (1860, Section III, para.25)
Instructions
In an essay, address the following:
You must answer both questions by making an argument for your position. Whichever type – argument or explanation.
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Stuck On This C Prompt A Student For Grades And Credits For Courses Taken Fro
/in Uncategorized /by developerIm stuck on this C++
IMPORTANT NOTES!
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Stuck On This Problem For A Positive Real Number X The Difference X X X Floor
/in Uncategorized /by developerIm stuck on this problem: For a positive real number x, the difference x*=x−[x] (floor) is called the fractional part of x. Given arbitrary positive real numbers a and b, state
a condition in terms of the fractional parts of a* and b* that is necessary and sufficient for [a+b] (floor) = [a] (floor) + [b] (floor). I’m trying to prove that this equation is true if and only if my condition holds.
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Stuck On Trying To Balance Out My Journal After I Put All Debits And Credit I
/in Uncategorized /by developerUnited States Treasury
13. If you used the QuickBooks Setup window to record customers and vendors, edit each customer and vendor to record the terms of payment. (See Step 11 and Step 12.)
14. To complete the New Company Setup, record the following three journal entries on July 1, 2019:
a. Enter the opening balances (refer to Step 8 above). Use Open Bal as the Entry No.
b. Make a journal entry to reverse the Uncategorized Income account, Rev.
c. Make a journal entry to reverse the Uncategorized Expenses account, Rev.
15. Display and print the following reports for July 1, 2019-July 1, 2019.
a. Journal
b. Trial Balance
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Taking My Final Rn Please Help Me Out 1 A Stock Has An Expected Return Of 15
/in Uncategorized /by developerim taking my final rn please help me out
1) A stock has an expected return of 15 percent, its beta is 1.4, and the expected return on the market is 12 percent. What must the risk-free rate be? (Do not round your intermediate calculations.)
4.27%
-1.80%
4.72%
4.68%
4.50%
2) A stock had returns of 6 percent, -22 percent, 18percent, 12 percent, and -2 percent over the past five years. What is the standard deviation of these returns?
15.52 percent
10.21 percent
13.49 percent
18.74 percent
11.68 percent
3) The Absolute Zero Co. just issued a dividend of $2.85 per share on its common stock. The company is expected to maintain a constant 5.9 percent growth rate in its dividends indefinitely.
If the stock sells for $57 a share, what is the company’s cost of equity? (Do not round intermediate calculations. Enter your answer as a percent rounded to 2 decimal pl0 aces, e.g., 32.16.)
4
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Taking Us History And Am Having A Hard Time Putting It All Together
/in Uncategorized /by developerHi I have 2 assignments to write about. Im taking Us History and am having a hard time putting it all together.Discuss the Black Legend and how to compare this legend to what Spain’s approach was to exploration, conquest, and colonization. do you think Spanish were worse, better, or about the same as other Europeans?What was the impact of political, religious and social instability in England on the establishmentof colonies in North America? Particularly, what effects did the English Civil War and theGlorious Revolution have on this side of the Atlantic Ocean? Think broadly along political, socialand economic and religious lines. Consider the impact on individual colonies as well as theaggregateiExplain your reasoning.
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Im Writing A Swot Analysis And Cdstep For The Australian Store Doughnut Time
/in Uncategorized /by developerIm writing a SWOT Analysis and CDSTEP for the australian store Doughnut Time. I’m not sure what industry doughnuts are included in and i can’t seem to find any information on that particular brand or an industry
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Image Orientation 0 5pt Draw The E In The Orientation That You Expect It To Be
/in Uncategorized /by developerI’m asking only for section 5.2 please. The ‘knob’ they are referring to is the knob of the microscope that’s printed in the picture of the attachment . Please ignore image orientation part.
Image orientation ( 0. 5pt ) -Draw the "e" in the orientation that you expect it to be in when*you view it on the microscope :"5. 2 Objective lens and depth of focus ( 2.0 pts )What focus knob is first used to bring the image to focus ? Whatobjective lens is first used to view the image ?"When the magnification increases , what happens to field of viewand depth of focus . Do they stay the same , decrease or increase ?"( Circle the answer ) .Some organelles were not seen under the compound lightmicroscope . Do you think better staining and a more powerfulmicroscope would have helped ?’ Yes or No
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Image That A Colleague Is Did You Believe That It Is Ever Justifiable To Engage
/in Uncategorized /by developerimage that a colleague is did you believe that it is ever justifiable to engage in illegitimate politicalbehaviours such as backstabbing/ if so,what are some condition that might justify such behaviours?
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"