Write a program that prompts for the user to input a sentence. : Write a program that prompts for the user to input a sentence. Then check this sentence to make sure the first word of the sentence is capitalized and the sentence ends with a punctuation mark. If it is not properly written, fix the sentence, print the type of error, and print the fixed sentence.


I was following the provided instructions for this class and keep getting an invalid syntax error for the fourth line of code. Was wondering if anyone knew why and could show me how to fix it or another way of writing this program.

    import string

    sentence = input("Enter a sentence ")

    class acceptSentence():

    punctuationcount = lambda a,b:len(list(filter(lamdba-c: c in b,a)))

    numberofpunctuationcount = punctuationscount(sentence,string.punctuation)

    for each in sentence:
        if each.startswith(each.upper()):
            print ("Starts with Capital letter ",each)

            break

        if (numberofpunctuations >=1):

            print("Sentence Ends with punctuation")

            else:
                print("Error: there is no punctuation mark at end of the sentence")


                obj = acceptSentence()
                obj.calculate(sentence)
