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
hjlf
3 years ago
14

PLS HELP ASAP! WILL GIVE BRAINLIEST!

Computers and Technology
1 answer:
Lesechka [4]3 years ago
8 0

Answer:

# Python program to demonstrate sorting by user's  

# choice  

 

# function to return the second element of the  

# two elements passed as the parameter  

def sortSecond(val):  

   return val[1]  

 

# list1 to demonstrate the use of sorting  

# using using second key  

list1 = [(1, 2), (3, 3), (1, 1)]  

 

# sorts the array in ascending according to  

# second element  

list1.sort(key = sortSecond)  

print(list1)  

 

# sorts the array in descending according to  

# second element  

list1.sort(key = sortSecond, reverse = True)  

print(list1)

You might be interested in
Let G = (V, E) be an undirected graph. Design algorithms for the following (in each
Degger [83]

Answer:

i think its b if not sorry

Explanation:

3 0
2 years ago
Write a program that prompts the user to enter a series of numbers between 0 and 10 asintegers. The user will enter all numbers
Anna71 [15]

Answer:

The program in Python is as follows:

import collections

from collections import Counter

from itertools import groupby

import statistics

str_input = input("Enter a series of numbers separated by space: ")

num_input = str_input.split(" ")

numList = []

for num in num_input:

         if(num.lstrip('-').isdigit()):

                   if num[0] == "-" or int(num)>10:

                             print(num," is out of bound - rejecting")

                   else:

                             print(num," is valid - accepting")

                             numList.append(int(num))

         else:

                   print(num," is not a number")

print("Largest number: ",max(numList))

print("Smallest number: ",min(numList))

print("Range: ",(max(numList) - min(numList)))

print("Mode: ",end = " ")

freqs = groupby(Counter(numList).most_common(), lambda x:x[1])

print([val for val,count in next(freqs)[1]])

count_freq = {}

count_freq = collections.Counter(numList)

for item in count_freq:

         print(item, end = " ")

         lent= int(count_freq[item])

         for i in range(lent):

                   print("#",end=" ")

print()

Explanation:

See attachment for program source file where comments are used as explanation. (Lines that begin with # are comments)

The frequency polygon is printed using #'s to represent the frequency of each list element

7 0
2 years ago
Unit 7 - Planning and Designing a Website
quester [9]

Am not sure about no.2 and no.4
But am going to answer
1.true
3.true
5.true
8 0
2 years ago
Which of the following is considered a benefit of using simulation programs? a. They allow users to experience potentially dange
erica [24]

Answer:

All of the above

Explanation:

7 0
3 years ago
Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res
Andre45 [30]

Answer:

a variable of type "double" is more suitable for finding average because average could be any number with decimal places. we can't use a variable of type "integer" because it will omit the value after the decimal and will not produce satisfactory results.  

Explanation:

an example of C++ code is given to find the average of two numbers a and b

#include <iostream>;

using namespace std;

int main() {

double a = 2.334;

double b = 34;

double average =  (a + b) / 2;

cout << average;

return 0;

}

5 0
3 years ago
Other questions:
  • Windows uses a graphical user interface (GUI), which means: a user can carry out commands by clicking, dragging, or otherwise ma
    6·1 answer
  • Tim has an old server computer that his company uses as a backup. One of the hard drives has gone bad and needs to be replaced.
    13·1 answer
  • Um can anyone who is really into science and physics answer this question
    7·1 answer
  • Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if
    13·1 answer
  • In what stage of an algae or fungi life cycle are they able to reproduce spores?
    10·1 answer
  • Which of the following is an advantage of using variables?
    9·1 answer
  • C++ Write a program that initially asks a user to enter two positive integer numbers a and b. If either a or are zero or negativ
    9·2 answers
  • When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustm
    13·1 answer
  • Which of the following terms refers to the cells that contain values and labels to be graphed in the chart?.
    6·1 answer
  • What plugs into this?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!