Expert answer:Python HomeworkCreate a script called homework7YN.py (where YN is your initials)Write a function countLetters that expects 2 input arguments: a sentence and a letter. The function will check the number of times the letter occurs in the sentence. The function counterLetter should return a number (number of times the letter occurred in the sentence).Write a function promptUser that prompts the user for a sentence and a letter. In promptUser, call countLetter with the sentence and letter you read in from the user. Save the value returned from the function and use in to append to a file count.txt.When you run the program it should look like…….(things you need to type are in red, text file contents in green). Submit both homework7YN.py and in the comments on Canvas list any global variable names in the program and local variable names in the program.>>promptUser( )Enter a sentence:Have a nice day!Enter a letter:aOpen file count.txt and see:3 a’s found in Have a nice day!————————————————>>promptUser( )Enter a sentence:CS118 is a great class!Enter a letter:sOpen file count.txt and see:3 a’s found in Have a nice day!3 s’s found in CS118 is a great class!————————————————–>>promptUser( )Enter a sentence:This is fun.Enter a letter:uOpen file count.txt and see:3 a’s found in Have a nice day!3 s’s found in CS118 is a great class!1 u’s found in This is fun.————————————————–>>scriptYNEnter a sentence:I can’t wait for summer.Enter a letter:zOpen file count.txt and see:3 a’s found in Have a nice day!3 s’s found in EGR115 is a great class!1 u’s found in This is fun.0 z’s found in I can’t wait for summer.
Expert answer:Python Homework
by writersseek | Feb 8, 2025 | Programming | 0 comments
Order a plagiarism free paper now. We do not use AI. Use the code SAVE15 to get a 15% Discount
Looking for help with your ASSIGNMENT? Our paper writing service can help you achieve higher grades and meet your deadlines.

Why order from us
We offer plagiarism-free content
We don’t use AI
Confidentiality is guaranteed
We guarantee A+ quality
We offer unlimited revisions