subject

Take a list of heights (in_lst) in different formats, for each one calculate height in milimeters (integer), and store it, or None (is not compliant with known format) in output list (out_list).Input: a list raw_lst of elements of many types: floats, ints, strings, bools, and potentially other weird data types. Particular value ranges of floats and ints represent heights in different formats:float between 2.75 and 9 (exclusive) indicates height in feet. float between 0.83 and 2.75 (exclusive) indicates height in meters. float between 12 and 108 (exclusive) indicates height in inches. integer between 83 and 275 (inclusive) indicates height in centimeters. integer between 830 and 2750 (inclusive indicates height in milimeters. Output: a list out_list of the same length as in_list. Each element of this list derives from a specific element of the in_list. Each element is either (a) an integer, corresponding to the index-matched element of in_list converted to height, in milimeters, or (b) None. Units: 1 foot = 12 inches; 1 inch = 2.54 cm; 1 meter = 100 cm; 1 cm = 10 mm;in_list = [5.5, 1.8, 69.5, 167, 2000, 6, 'six feet', '2 meters', b'4a', (5, 8), {'height':69}]out_list == [1676, 1800, 1765, 1670, 2000, None, None, None, None, None, None]

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Alocal reaction will occur at the site of the exposure such as irritation or damage to the skin eye or local reaction will occur at the site of the exposure such as irritation or damage to the skin ireland lounges
Answers: 3
question
Computers and Technology, 22.06.2019 04:00
Chloe is building a kiosk-based excel application. she wants to make some modifications to the screen elements in order to keep users from being distracted by parts of the application that are irrelevant to her application. she turns to henry for guidance as she knows he built a similar solution earlier this year.chloe has decided to hide the worksheet gridlines and the vertical scroll bar. what does henry tell her to use to do this? a) screen elements dialog boxb) display options dialog boxc) customization dialog boxd) excel options dialog box
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 23.06.2019 06:20
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
Answers: 1
You know the right answer?
Take a list of heights (in_lst) in different formats, for each one calculate height in milimeters (i...
Questions
question
Physics, 30.07.2021 14:00
Questions on the website: 13722363