Several of the
Design an application that accepts 10 numbers and displays them in descending order.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- The 'Expert answer's you have posted is blank! Please provide an answer This program requires the main function and a custom value-returning function. In the main function, code these steps in this sequence: use a list comprehension to generate 50 random integers all from -40 to 40, inclusive. These represent Celsius temperatures. use an f_string to report the lowest and highest Celsius temperature in the list. determine if 0C is in the list. If it is report the index where it first occurs. If it isn't in the list, report that, too. use a random module method to create a sublist of 10 unique Celsius temperatures. sort this sublist in ascending order. pass the Celsius sublist as the sole argument to the custom value-returning function. In the custom function: use either a loop or a list comprehension to create a list of 10 Fahrenheit temperatures equivalent to the Celsius temperatures. A bonus of 3 points will be awarded if a list comprehension is employed. return the…arrow_forwardreverse_number_in_list(number_list:list)-> list This function will be given a list of numbers your job is to reverse all the numbers in the list and return a list with the reversed numbers. If a number ends with 0 you need to remove all the trailing zeros before reversing the number. An example of reversing numbers with trailing zeros: 10 -> 1, 590 -> 95. None of the numbers in the number_list will be less than 1. Example: number_list = [13, 45, 690, 57] output = [31, 54, 96, 75]arrow_forwardName: Na ID: A Name: 3. An algorithm will be used to identify the maximum value in a list of one or more integers. Consider the two versions of the algorithm below. Algorithm I: Set the value of a variable max to - 1. Iterate through the list of integer values. If a data value is greater than the value of the variable max, set max to the data value. Algorithm II : Set the value of a variable max to the first data value. Iterate through the remaining values in the list of integers. If a data value is greater than the value of the variable max, set max to the data value. Which of the following statements best describes the behavior of the two algorithms? Algorithm I always works correctly, but Algorithm II only works correctly when the maximum value is not the first value Both algorithms work correctly on all input values. а. с. in the list. b. Neither algorithm will correctly identify d. Algorithm II always works correctly, but the maximum value when the input contains both positive and…arrow_forward
- 2. For each of the following Python list methods indicate whether the method mutates the list Write "yes" if the method mutates the list or "no" if the method does not mutate the list. insert count remove poparrow_forwardNotice that all of the data in the inner lists are represented as strings. You are to write the function convert_data, which should make modifications to the inner lists according to the following rules: If and only if a string represents a whole number (ex: '3' or '3.0'), convert the string to an int. If and only if a string represents a number that is not a whole number (ex: '3.14'), convert the string to a float. Otherwise, leave the string as a str.HINT: The provided helper function is_number may be used (attached image). QUESTION: Complete the docstring below.def convert_data(data: List[list]) -> None: """Convert each string in data to an int if and only if it represents a whole number, and a float if and only if it represents a number that is not a whole number. >>> d = [['abc', '123', '45.6', 'car', 'Bike']] >>> convert_data(d) >>> d [['abc', 123, 45.6, 'car', 'Bike']] >>> d = [['ab2'], ['-123'], ['BIKES', '3.2'],…arrow_forwardLab Goal : This lab was designed to teach you more about list processing and algorithms.Lab Description : Write a program that will search a list to find the first odd number. If an odd number is found, then find the first even number following the odd number. Return the distance between the first odd number and the LAST even number. Return -1 if no odd numbers are found or there are no even numbers following an odd numberarrow_forward
- Explains how the selected list manages complexity in your program code by explaining why your program code could not be written, or how it would be written differently, if you did not use the list.arrow_forwardSelect problem below. Your post must include: The problem statement. A description of your solution highlighting the use of the split(), join(), lists and the different list operations involved in solving the problems. Include line numbers from your program dont use JAVA Make Username. Create a program that reads a full name as a single string, and and uses the split creates a username with the following rules: The first character of the username is the first character of the first name. The second character of the username is the first letter of the middle name, if one was provided. The rest of the characters will be a prefix of the last name, long enough to meet the length requirement. The username can have up to 8 characters only, and in lowercase. Here is a sample execution:arrow_forwardIm Python pleasearrow_forward
- python help, please show all steps and include comments Write a function largerLst() that takes a list of numbers (i.e., int or float values) as a parameter and returns a new list constructed out of it. The list returned has all the values in the parameter list that are larger than the element immediately to their right, that is, larger than their right neighbor. If the parameter list is empty or there are no values larger than their right neighbor, then the function returns an empty list. Note that the last element in the list will never be included in the list returned since it does not have a right neighbor. The function should not change the parameter list in any way. Note that a correct solution to this problem must use an indexed loop That is, one that makes a call to the range() function to generate indices into the list which are used to solve the problem (Review lecture notes 8-1). A solution that does not use an indexed loop will not be accepted. Note in particular that you…arrow_forwardIn python, Problem Description:You are hosting a party and do not have room to invite all of your friends. You use the following unemotional mathematical method to determine which friends to invite. Number your friends 1, 2, . . . , K and place them in a list in this order. Then perform m rounds. In each round, use a number to determine which friends to remove from the ordered list. The rounds will use numbers r1, r2, . . . , rm. In round i remove all the remaining people in positions that are multiples of ri (that is, ri, 2ri, 3ri, . . .) The beginning of the list is position 1. Output the numbers of the friends that remain after this removal process. Input Specification:The first line of input contains the integer K (1 ≤ K ≤ 100). The second line of input contains the integer m (1 ≤ m ≤ 10), which is the number of rounds of removal. The next m lines each contain one integer. The ith of these lines (1 ≤ i ≤ m) contains ri ( 2 ≤ ri ≤ 100) indicating that every person at a position…arrow_forwardPython code please help, indentation would be greatly appreciatedarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY