So in school we're making a Automated readability index and i'm having some trouble with getting the provided formula to work.
Reading age of text = 4.71 × (Characters/Words)+ 0.5 × (Words/Sentences)– 21.43
I have this so far and was wondering if i could have some help.
#password for authorization
userName = input("""Welcome to the Asterisk school's automated reading index.
Please enter your name: """)
password = "123"
print("Welcome to the Reading index " + userName, """-- where we test your reading ability!""")
password = input("Please enter the password: ")
if password == "123":
print("Access granted")
else:
print("Please try again or contact the system administrator")
#this is where all the books will be stored
harryPotter = ("""Mr. and Mrs. Dursley, of number four, Privet Drive, were proud\n to say that they were perfectly normal, thank you very much. They were\n the last people you'd expect to be involved in anything strange or mysterious,\n because they just didn't hold with such nonsense""")
jamesAndTheGiantPeach = ("""When James accidentally drops some magic crystals by the old\n peach tree, strange things start to happen. The peach at the top of the\n tree begins to grow, and before long it's as big as a house. When James\n discovers a secret entrance way into the fruit and crawls inside, he meets\n wonderful new friends--the Old-Green-Grasshopper, the dainty Ladybug\n and the Centipede of the multiple boots.""")
diaryOfAWimpyKid = ("""First of all, let me get something straight: This is a JOURNAL \nnot a diary. I know what it says on the cover, but \nwhen Mom went out to buy this thing I SPECIFICALLY told\n her to get one that didn't say "diary" on it \nGreat. All I need is for some jerk to catch me \ncarrying this book around and get the wrong idea.""")
catInTheHat = ("""The sun did not shine \nit was too wet to play\n so we sat in the house\n all that cold, cold, wet day.""")
theLorax = (""" At the far end of town\nwhere the Grickle-grass grow\nsand the wind smells slow-and-sour when it blows\nand no birds ever sing excepting old crows\nis the Street of the Lifted Lorax\nAnd deep in the Grickle-grass, some people say\nif you look deep enough you can still see, today\nwhere the Lorax once stood\njust as long as it could\nbefore somebody lifted the Lorax away\nWhat was the Lorax\nAnd why was it there\nAnd why was it lifted and taken somewhere\nfrom the far end of town where the Grickle-grass grows\nThe old Once-ler still lives here\nAsk him. He knows.""")
theHobbit = ("""In a hole in the ground there lived a hobbit. Not a nasty,\n dirty, wet hole, filled with the ends of worms and an oozy smell, nor\n yet a dry, bare, sandy hole with nothing in it to sit down on or to eat:\n it was a hobbit-hole, and that means comfort.""")
theLordOfTheRings = ("When Mr. Bilbo Baggins of Bag End announced that he would\n shortly be celebrating his eleventy-first birthday with a party of\n special magnificence, there was much talk and excitement in Hobbiton.")
#using ascii art cause it looks cool
print("""
_____ _ _ _ _
/ ____| | | | | | | |
| | | |__ ___ ___ ___ ___ __ _ | |__ ___ ___ | | _| |
| | | '_ \ / _ \ / _ \/ __|/ _ \ / _` | | '_ \ / _ \ / _ \| |/ / |
| |____| | | | (_) | (_) \__ \ __/ | (_| | | |_) | (_) | (_) | <|_|
\_____|_| |_|\___/ \___/|___/\___| \__,_| |_.__/ \___/ \___/|_|\_(_)""")
#i wasnt sure how to make all letters recognised as a capital
choice = input("""\n A:Harry Potter \n B:James and the giant peach\n C:Diary of a wimpy kid \n D:Cat in the hat \n E:The Lorax \n F:The lord of the rings
G:The Hobbit \n """)
#this is where the right text is selected according to the users request
if choice == "a":
print(harryPotter)
elif choice == "b":
print(jamesAndTheGiantPeach)
elif choice == "c":
print(diaryOfAWimpyKid)
elif choice == "d":
print(catInTheHat)
elif choice == "f":
print(theLordOfTheRings)
elif choice == "g":
print(theHobbit)
elif choice == "e":
print(theLorax)
else:
print("\nThis text doesn't exist.")
#this is where their reading age is printed
#the answer that would be printed below is the number that comes out after the calculation is done
input("\n\nPress enter to exit")
Anyway thanks in advance and if you don't have anything constructive to say don't bother commenting please. And i'm using version 3.6.4 if anyone wants to know