1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kodGreya [7K]
4 years ago
7

The Springfork Amateur Golf Club has a tournament every weekend. The club president

Computers and Technology
1 answer:
Lera25 [3.4K]4 years ago
6 0

Answer:

The Python code is given below for each question.

Explanation:

1:

 if __name__ == '__main__':

   f = open('golf.txt', 'w')

   n = int(input("Enter number of players:"))

   for i in range(n):

       name = input("Enter name of player number " + str(i + 1) + ":")

       score = int(input("Enter score of player number " + str(i + 1) + ":"))

       f.write(name + "\n" + str(score) + "\n")

   f.close()

2:

try:

   with open('golf.txt') as r:

       lines = r.readlines()

       for i in range(0, len(lines), 2):

           print("Name:", lines[i].strip())

           print("Score:", lines[i+1].strip())

           print()

except FileNotFoundError:

   print("golf.txt is not found!")

You might be interested in
Pls help me thx would really help me
Assoli18 [71]

Answer:

rooster don't lay eggs tho

4 0
3 years ago
Read 2 more answers
what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
Andrews [41]

google does that, and yahoo, and bing. it would be a search engine, or browser.

5 0
3 years ago
For this programming assignment you will implement the Naive Bayes algorithm from scratch and the functions to evaluate it with
DanielleElmas [232]

Bayes’ Theorem provides a way that we can calculate the probability of a piece of data belonging to a given class, given our prior knowledge.

P(class|data) = (P(data|class) * P(class)) / P(data)

Where P(class|data) is the probability of class given the provided data.

Explanation:

  • Naive Bayes is a classification algorithm for binary  and multiclass classification problems.
  • It is called Naive Bayes or idiot Bayes because the calculations of the probabilities for each class are simplified to make their calculations tractable.

This Naive Bayes tutorial is broken down into 5 parts:

Step 1: Separate By Class :  Calculate the probability of data by the class they belong to, the so-called base rate. Separate our training data by class.

Step 2: Summarize Dataset : The two statistics we require from a given dataset are the mean and the standard deviation

The mean is the average value and can be calculated using :

mean = sum(x)/n * count(x)

Step 3: Summarize Data By Class : Statistics from our training dataset organized by class.

Step 4: Gaussian Probability Density Function : Probability or likelihood of observing a given real-value. One way we can do this is to assume that the values are drawn from a distribution, such as a bell curve or Gaussian distribution.

Step 5: Class Probabilities :  The statistics calculated from our training data to calculate probabilities for new data.  Probabilities are calculated separately for each class. This means that we first calculate the probability that a new piece of data belongs to the first class, then calculate the second class, on for all the classes.

8 0
4 years ago
To perform a what-if analysis with more than two input cells, you _______.
yulyashka [42]
Scenarios are created and simulated in order to <span>perform a what-if analysis with more than two input cells. These scenarios are very essential to the development of the study of different variables affecting the two input cells who be assessed properly by manipulating and controlling them for the desired outcome.</span>
8 0
3 years ago
Relieved to have survived ,henry rolled off the rink________.giving alex a grateful look
Marina86 [1]

Answer:

simultaneously might be the answer

8 0
3 years ago
Other questions:
  • In pre-shared key mode, a passphrase should be at least ________ characters long.
    15·1 answer
  • Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
    13·1 answer
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • Which task is performed by the artificial intelligence programmer?
    7·1 answer
  • ______allow you to select elements that are in a certain state, such as when the mouse if hovering over an element
    14·1 answer
  • A ___________ variable is used to add up a set of values. fill in the blank
    8·1 answer
  • Which of these tools can best be used as a self assessment for career planning purposes?
    6·2 answers
  • Write a Java program that prompts for integers and displays them in binary. Sample output: Do you want to start(Y/N): y Enter an
    7·1 answer
  • I don 't have a question but i want to use video filter but when i click it there was no frames i want to use it .Please
    8·2 answers
  • The electors in each state shall have the qualifications requisite for electors of the most numerous branch of the state legisla
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!