SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 3 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 11 Dec 2017 My Price 10.00

program that creates a dictionary containing the U.S.

Hello there, I am having trouble completing these exercises from Starting Out With Python Third Edition:

Chapter 7 Exercise 6 Larger Than n

 

The a program, write a function that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display all of the number in the list that are greater than number n.

 

Chapter 8 Exercise 6

Average Number of words

 

Write a program that reads the file's contents and calculates the average number of words per sentence.

 

Here is my code:

 

def main():

  space = 0

 

   

  infile = open('text.txt', 'r')

 

  #Read data into a list.

 

  sentence = infile.read()

 

  #at the end of your function be sure to close the file

 

  infile.close()

 

  word = sentence.split(" ")

 

You can also download the text file.

 

  for word in sentence:

    word = len(word)

   

    space = space + 1

       

       

    print("The number of words in the sentence if", space, sep =" ")

       

     

   

main()

 

Chapter 9 Exercise 2

Capital Quiz

 

Write a program that creates a dictionary containing the U.S. States as key and their capitals as values. The program should then randomly quiz the user by displaying

the name of a state and asking the user to enter that state capital. the program should keep a count of the number of correct and incorrect responses.

Attachments:

Answers

(5)
Status NEW Posted 11 Dec 2017 02:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)