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
The true or false questions.
tankabanditka [31]

Answer:

false

Explanation:

-exec option is not mandatory for the find command.

find will still list out the identified files even in the absence of -exec option.

For example:

find . -name test -print

will print out files with the name 'test' in the current directory. Note that there is no exec option in this example.

Same holds true for find with no additional options at all.

For example:

find .

will list out all files in the current directory.

3 0
3 years ago
Sharing resources.
olya-2409 [2.1K]

Answer:

Explanation:

2- Multitasking Multitasking – Multitasking Multitasking is one among the main advantage of computer. ...

Speed – Now computer isn't just a calculating device. ...

Cost/ Stores huge – Amount of knowledge it's a coffee cost solution. ...

Accuracy – ...

Data Security – ...

Task completer – ...

Communication – ...

Productivity –

More items...•

6 0
2 years ago
What steps do you need to take to register
ratelena [41]
Depends on what you are registering for but you will most likely need your First and last Name, Email, and a secure password... that's for most signups.
7 0
3 years ago
A large retail company hires several new joiners and would like to incorporate Virtual Reality (VR) into their onboarding proces
Volgvan

 The best utilize VR for this purpose is a simulated experience interacting with customers.

<h3>What is Virtual reality (VR)?</h3>

Virtual Reality (VR) is known to be a kind of computer created environment that is made up of scenes and objects that seems to be real.

It is a type of reality that makes its  user feel they are inside their surroundings. This environment is said to be seen via device known as a Virtual Reality headset or helmet.

See options below

Which approach would best utilize VR for this purpose?

an animated video that covers compliance training

a 360-degree online tour of the retail store

an application that enables online contract signing

a simulated experience interacting with customers

Learn more about Virtual Reality (VR) from

brainly.com/question/26705841

4 0
2 years ago
Which type of data is most sensitive and should be protected from malware?
Dennis_Churaev [7]
The correct answer is “C. The credit card number that you use to make an online purchase”
5 0
1 year ago
Other questions:
  • A __________ is the column of data in a database that is used as the basis for arranging data.
    8·2 answers
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • If you have a windows 8, but want the features of windows 8 pro, purchase and install _______.
    7·1 answer
  • Which scenario depicts an ethical workplace practice by a business owner? A. sharing personal information of its employees with
    8·2 answers
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • Which agency coordinate the Internet's IP addressing and DNS system.
    15·1 answer
  • Identify at least five different Information Technology careers that you could pursue in your home state, and choose the three t
    10·2 answers
  • An anagram is a word or a phrase made by transposing the letters of another word or phrase; for example, "parliament" is an anag
    7·1 answer
  • Privacy Group of answer choices must be respected if we are to function as complete, self-governing agents is an absolute value
    5·1 answer
  • Several small stores rent space within a larger shopping centre. The owners of the shopping centre have provided a physical netw
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!