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
Mkey [24]
3 years ago
15

Any suggestions on how to write the following Python code?

Computers and Technology
1 answer:
Ksju [112]3 years ago
6 0

Answer:

Hi

Explanation:

You might be interested in
How can you make the LED pattern continue to blink a certain number of times or indefinitely?
Maurinko [17]

Answer:

press flash

Explanation:

its on the bottom row on the remote on mine

8 0
3 years ago
Read 2 more answers
Assignment Background Video games have become an outlet for artists to express their creative ideas and imaginations and a great
Sphinxa [80]

Answer:

Code

import csv

def open_file():

try:

fname=input("Enter the filename to open (xxx.yyy): ")

fp=open(fname,encoding='utf-8')

return fp

except FileNotFoundError:

print("File not found! Please Enter correct filename with extension")

return open_file()

def read_file(fp):

fields = []

rows = []

csvreader = list(csv.reader(fp))

# skiped 1 row because it contains field name

fields = csvreader[0]

D1={}

D2={}

D3={}

# accessing the data of csv file

for line in csvreader[1:]:

name = line[0].lower().strip()

platform = line[1].lower().strip()

if line[2]!='N/A':

year = int(line[2])

else:

year=line[2]

genre = line[3].lower().strip()

publisher = line[4].lower().strip()

na_sales = float(line[5])

eur_sales = float(line[6])

jpn_sales = float(line[7])

other_sales = float(line[8])

global_sales=(na_sales+eur_sales+jpn_sales+other_sales)*1000000

if name not in D1:

D1[name]=[]

D1[name].append((name, platform, year, genre, publisher,global_sales))

if genre not in D2:

D2[genre]=[]

D2[genre].append((genre, year, na_sales, eur_sales,jpn_sales, other_sales, global_sales))

if publisher not in D3:

D3[publisher]=[]

D3[publisher].append((publisher, name, year, na_sales,eur_sales, jpn_sales, other_sales, global_sales))

# sorting

temp={}

# sorting keys

for Keys in sorted (D1) :

ls=D1[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D1=temp.copy()

temp={}

# sorting keys

for Keys in sorted (D2) :

ls=D2[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D2=temp.copy()

temp={}

# sorting keys

for Keys in sorted (D3) :

ls=D3[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D3=temp.copy()

return D1,D2,D3

 

def main():

fp=open_file()

D1,D2,D3=read_file(fp)

# displaying the row_count in dictionaries

cnt=0

for d in D1:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

cnt=0

for d in D2:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

cnt=0

for d in D3:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

 

 

if __name__=="__main__":

main()

Explanation:

see code and see output attached

7 0
3 years ago
What are several different types of software, which sit in the middle of and provide connectivity between two or more software a
brilliants [131]

Answer:

The answer to the given question is the option "a".

Explanation:

In this question, the answer is "middleware" software because this software works between the operating system and the applications that provide connectivity to two or more software applications. for example database, application server, etc and other choices that are not correct can be described as:

  • In option b, The integration middle wear represents the software of the system. It does not coordinate between operating and application software.
  • In option c, It is used to manage the data and the information for the process.
  • In option d, It includes the hardware, software and the networks. In this hardware and software link for use software.

That's why the answer to this question is the option "a".

6 0
3 years ago
If there has been no change in the data regarding a specific person, place or thing, information about that person, place or thi
babymother [125]
I think it’s b false sorry if I was wrong
6 0
3 years ago
The communications standard used to transfer pages on the Web is called _____.
andrezito [222]
Hypertext Transfer Protocol (HTTP)
5 0
3 years ago
Other questions:
  • Lossless and lossy are the two (2) universally known categories of compression algorithms. Compare the two (2) categories of alg
    8·2 answers
  • 1. What is the main factor that affects Earth’s average temperature?
    12·1 answer
  • You have a number of digital pictures you recently took on your smartphone. You would like to share these pictures with all of y
    9·2 answers
  • One of the first signals that an organization is making progress in the development of its IR program, specifically in the devel
    6·1 answer
  • [ANSWER = BRAINLIEST] How to mark an answer as brainliest?
    13·2 answers
  • The HTTP protocol operates at which layer?
    7·1 answer
  • What type of code do computers typically use to operate? A. CSS B. HTML 5 C. HTML D. Binary
    12·2 answers
  • From your fist impression, write down what first comes to mind as to what is good and bad about the way the device works.
    14·1 answer
  • When the binary code is retrieved from ram and moved to the cpu, this stage is known as
    8·1 answer
  • Edit the program provided so that it receives a series of numbers from the user and allows the user to press the enter key to in
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!