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

Create a Python program that:

Computers and Technology
1 answer:
Charra [1.4K]3 years ago
4 0

Answer:

```

file = open("trips.txt","r")

file = file.split("\n")

trip_date = []

fuel_used = []

miles_traveled = []

for i in file:

   trip_date.append(i.split(", ")[0])

for i in file:

   fuel_used.append(i.split(", ")[1])

for i in file:

   miles_traveled.append(i.split(", ")[2])

```

This should put the data in their own lists (i didn't test it) but im not going to solve everything for you. The rest is for you to tinker with. You shouldn't throw your question at us and expect an answer. This is the most that I will give you.

Explanation:

You might be interested in
The Constitution party advances a conservative approach to issues and would most likely support policies that __________.
vodka [1.7K]
The correct answer for this question is this one
reflect our basic principles." The Constitution party advances a conservative approach to issues and would most likely support policies that <span>reflect our basic principles and as well as respect whatever what we believe in.</span>
3 0
3 years ago
The Mifflin Cable store in Buffalo is currently offering a fabulous marketing strategy for potential new cable and Internet cust
worty [1.4K]

Answer:

Decrease buyer power

Explanation:

The company is trying to decrease the power that buyers have by ensuring that the market system is properly controlled. The company wants to regulate the economic conditions of the market and have the controlling power of the market system. Gifts and other benefits are offered by the company to the buyers to coarse them.

8 0
4 years ago
Define a function dice(n) that returns the sum of a random roll of n 6-sided dice. Example output in photo. Thank you
leonid [27]

Answer:

code (in python) is in the explanation

Explanation:

import random

def dice(n):

   count = 1

   t = list()

   while count <= n:

       i = random.randint(1,6)

       t.append(i)

       count += 1

   print(sum(t))

Hope this helps!

6 0
3 years ago
Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
victus00 [196]

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

3 0
3 years ago
Why are people's visions of utopias and dystopias subjective?
Leno4ka [110]

Answer:

D. Because the technology needed for one person's utopia may be what creates disaster for another person's dystopia.

Explanation:

3 0
3 years ago
Other questions:
  • What is statement used to communicate ones feelings in a nonconfrontational manner
    9·1 answer
  • 8.8 Lab: Swapping variables Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the
    15·1 answer
  • Select the guidelines you should follow when creating a resume
    12·2 answers
  • How long would it take a 8 bit computer to calculate π to the thousandth place?
    8·1 answer
  • The date your Science project is due should be recorded on a daily organizer. Please select the best answer from the choices pro
    14·2 answers
  • Which of the following is most likely to require use of a server, desktop, and industry-specific handheld computer, and is most
    8·1 answer
  • Match the items with their respective descriptions. organizes files make files easily searchable keeps track of file creation an
    14·1 answer
  • Can some one help me i do not now how to give a BRANLEST. if you help i will give you one BRANLEST.
    7·2 answers
  • Que medios se utilizan para respaldar información?
    8·1 answer
  • List any four common hardware device​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!