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 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 22.06.2019 05:00
Are special characters that allow you to search for multiple words at the same time.
Answers: 2
question
Computers and Technology, 23.06.2019 01:20
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
You know the right answer?
1: Comparisons, and logical operators Each of the questions below uses the variable height (which y...
Questions
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
question
Mathematics, 23.08.2021 05:50
Questions on the website: 13722367