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, 23.06.2019 18:00
File account.java (see previous exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a string representation. note that the constructor for this class creates a random account number. save this class to your directory and study it to see how it works. then write the following additional code: 1. suppose the bank wants to keep track of how many accounts exist. a. declare a private static integer variable numaccounts to hold this value. like all instance and static variables, it will be initialized (to 0, since it’s an int) automatically. b. add code to the constructor to increment this variable every time an account is created. c. add a static method getnumaccounts that returns the total number of accounts. think about why this method should be static - its information is not related to any particular account. d. file testaccounts1.java contains a simple program that creates the specified number of bank accounts then uses the getnumaccounts method to find how many accounts were created. save it to your directory, then use it to test your modified account class.
Answers: 3
question
Computers and Technology, 24.06.2019 01:30
Suppose a cpu with a write-through, write-allocate cache achieves a cpi of 2. what are the read and write bandwidths (measured by bytes per cycle) between ram and the cache? (assume each miss generates a request for one block.)
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
question
Computers and Technology, 25.06.2019 01:00
Why is outfitting a workplace with video games in a technology development company consiered a strategic use of money
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
Mathematics, 26.12.2019 22:31
question
Mathematics, 26.12.2019 22:31
question
Mathematics, 26.12.2019 22:31
Questions on the website: 13722367