subject

1: Comparisons, and logical operators Each of the questions below uses the variable height (which you do not get to see yet) to determine how you should set other variables.
ans_3example (we provide code for this one, as an example): If height is...
a string, equal to 'tall', set ans_3example to 2.0 (float)
a string, equal to 'short', set ans_3example to 1.0 (float)
an integer, set ans_3example to height converted to a float
a float, set ans_3example to height
otherwise set ans_3example to None
ans_3a: if height if a float, set and_4a to 'Float', otherwise, 'No'
ans_3b: if height is...
an integer greater than or equal to 18, then set ans_3b to 'voting age',
2: loop
Use a for-loop to build an output list (out_list) given some input list (in_list). Each element of the out_list list should be the integer 1 (if the corresponding element of in_list is a number (integer or float) or the integer 0 otherwise.
an integer less than 18, then set ans_3b to 'not yet voting',
is a float set ans_3b to "integer years only please",
anything else, set ans_3b to 'numbers please'
ans_3c: if height is an integer or a float, then set to height*4 otherwise to None.
Q3: Cleaning, Specification
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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
You know the right answer?
1: Comparisons, and logical operators Each of the questions below uses the variable height (which y...
Questions
question
Mathematics, 24.05.2020 05:58
Questions on the website: 13722360