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]
3 years ago
7

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

Computers and Technology
1 answer:
Lera25 [3.4K]3 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
Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:
ArbitrLikvidat [17]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 

 System.out.print("Enter a number: ");

 int userVal = input.nextInt();

 

 String aString;

 if(userVal < 0)

     aString = "negative";

 else

     aString = "non-negative";

     

 System.out.println(aString);

}

}

Explanation:

Ask the user to enter a number and set it to userVal

Check the value of userVal. If it is smaller than 0, set the string as "negative". If it is not, set it as "non-negative"

Print the string

8 0
3 years ago
A network that is located in a small area, such as a single building is called a
love history [14]
Networks in small areas are called Local Area Network (LAN). LAN's are in small areas like offices and buildings. Computers close to each other can make up a LAN network with the right equipments. A LAN network is good for doing business.
4 0
3 years ago
Coding with Loops Worksheet
vovangra [49]
Mmmmmmmmmmmmmmmmmmmmmmmm
7 0
2 years ago
Read 2 more answers
The game often becomes stuck on landscape mode when tilting the device during gameplay, which cuts off some peripheral text. A w
ch4aika [34]

Answer:

The overview of the given situation is described in the explanation segment below.

Explanation:

  • Bug Severity seems to be the extent of influence that somehow a fault will have on the device, while its primary concern is indeed the command of severity that had already affected that same device.
  • You should consider this error as top importance as another framework hangs. I would say you may be lacking the configuration manager settings in your system.

Therefore the above is the right answer.

3 0
2 years ago
You compared each letter in the correct word to the letter guessed.
Murrr4er [49]

Answer:

wow

Explanation:

www

7 0
2 years ago
Other questions:
  • Write a complete program to do the following: The main program calls a method to read in (from an input file) a set of people's
    12·1 answer
  • Create a program the outputs the total cost of a lunch order. Users should be prompted to input the number of hamburgers, fries,
    6·1 answer
  • Match these items. 1 . Naturalization Act stated that a foreigner had to live in the United States fourteen years to become a ci
    5·1 answer
  • A tower or mini tower pc is a type of all- in -one unit true or false
    9·2 answers
  • Wap to input any multi digits number and display the sum of odd digits and even digits​
    5·1 answer
  • An ironworker standing 30 feet in the air is safe wearing a full body harness that is not tied off
    15·2 answers
  • Reflection about information technology​
    11·1 answer
  • What role do play in medicine ​
    11·1 answer
  • Please help me with coding!
    7·2 answers
  • The ________ function will change a character argument from lowercase to uppercase. isupper toupper tolarge fromlower none of th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!