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
Ronch [10]
2 years ago
6

Write a program to sort the (name, age, score) tuples by descending order where name is string, age and score are numbers. The s

ort criteria is: 1: Sort based on name 2: Then sort based on age 3: Then sort by score The priority is that name < age < score. If the following tuples are given as input to the program: [('John', '20', '91'), ('Jason', '21', '85'), ('Jony', '17', '91'), ('Johny', '17', '93'), ('Tom', '19', '80')]\
Computers and Technology
1 answer:
zimovet [89]2 years ago
6 0

Answer:

The program in Python is as follows:

from operator import itemgetter

m = int(input("Number of records: "))

print("Name, Age, Score")

my_list =[]

for i in range(m):

   user_details = input()

   my_list.append(tuple((user_details.split(","))))

my_list.sort(key =  itemgetter(0, 1, 2))        

print("Sorted: ", my_list)

Explanation:

This imports the operator function from itemgetter

from operator import itemgetter

This gets the number of records, m

m = int(input("Number of records: "))

This prints the format of input

print("Name, Age, Score")

This initializes the list of tuples

my_list =[]

This iterates through m

for i in range(m):

This gets the details of each person

   user_details = input()

This appends the details to the tuple

   my_list.append(tuple((user_details.split(","))))

This sorts the tuple

my_list.sort(key =  itemgetter(0, 1, 2))        

This prints the sorted tuple

print("Sorted: ", my_list)

You might be interested in
A two-dimensional array of characters can contain Group of answer choices
Ber [7]

Answer: All of these.

Explanation:   Lets take a two-dimensional array alphabet[4][4]

Lets say this array contains the following elements: Example 1

a b c d

l  i  o  n

f e  l   l

s t  e  m

These are the strings with same length. So this 2D array can contain strings of same length.

Now lets take another 2D array Example 2

a b c

h  i  n  t

s  o

e g  g

2D array can have all these above mentioned elements. So it can contain strings of different lengths.

Now consider the Example 2. Some places for the elements are left. This isn't an issue for 2D array. So it can contain uninitialized elements too.

So the answer is All of above.

6 0
3 years ago
Windows enables each user to establish a ____, which identifies to windows the resources, such as apps and storage locations, a
BlackZzzverrR [31]
The answer is A. User account.

Hope this helped!

Please mark brainliest answer ;D


3 0
3 years ago
In learning information security, it is important to understand that threats to your company's information assets are present 24
coldgirl [10]

1. Acts of human error

<u>Explanation:</u>

Insecurity their are many threats that make a desktop or workstation or laptop.  Normally end users have to update operating systems and virus signature updates by periodic scheduling task moreover to avoid threats end-user also have to do periodic scheduling scanning. And the virus cleaning. Download the third-party malware and spyware and then the cleaning process.

End-users have made sure all required service is activated and running in the organization.

The team has to make sure any software threats are found in PC or workstation or laptop or desktop or LAN and try to remove make system up running without any threats.

8 0
3 years ago
What is contrast (in Photography)?
kozerog [31]

Answer:

Contrast is a tool that photographers use to direct viewers' attention to their subject. There are two types: Tonal Contrast and Color Contrast. TC refers to the difference in tones from the lightest tone to the darkest tone, in other words, the difference in tones from white to gray to black.

Explanation:

heheh there you go

3 0
3 years ago
Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
Korvikt [17]

A designer should always balance the placement of text and graphics and create room for every element to breathe. When this is followed, the flyer template will create a feeling of balance and calm.


Consider adding a border: Borders can help your flyer or newsletter stand out wherever it is placed. Selection of certain colors, Italics and ALL CAPS can draw attention to particular points in a text.


Boost contrast with style, color and font size: Always use font weight to differentiate sections of text. Many fonts offer regular, bold and light options for font weight.


Align text for a balanced look: A designer should consider using a grid system that contains intersecting vertical and horizontal lines that are often based on optimal proportions for the document’s size. Aligning text in the center will give a pleasant symmetrical look.






7 0
3 years ago
Read 2 more answers
Other questions:
  • To create a digital file from an old photo, I would use a _____.
    10·1 answer
  • Help asap. 10 points.
    8·2 answers
  • What type of document would you use the landscape page orientation
    7·1 answer
  • What three steps Name a group??
    14·1 answer
  • Which best describes the benefits of renting a home?
    10·2 answers
  • Mr. Perry has bookmarked a large number of webpages in Chrome while researching class topics. Unfortunately, he's bookmarked so
    13·1 answer
  • What important feature of an email gives you a clue about what the sender wants to tell you?
    12·2 answers
  • Why do bats sleep upside down
    7·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • Write a script that checks to see if at least one argument has been given on the command line and tests whether the argument is
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!