Menu

[Solved]-Q12 Loops Odd Even 05 Points Write Loop Going Check Whether Values Datalist Even Odd Use L Q37245337

In python

Q12 - Loops: Odd or Even (0.5 points) Write a for loop that is going to check whether the values in data_list are even or odd

Q12 – Loops: Odd or Even (0.5 points) Write a for loop that is going to check whether the values in data_list are even or odd. Use a for loop with a conditional to do this. For each value, it should add True to a new list is_even if the value is even, and False to is_even if the value is odd In [ 1: | # rotR CODE HERE raise NotImplementedError) In : assert isinstance(is_even, list) assert (len(is_even)len (data list)) Q13- Loops: Multiple Conditions (0.75 points) Write a for loop that will check each value in data_list to see if they are even or odd and whether they are positive or negative. If they are both positive and even, encode this as the number 1 If they are both negative and odd, encode this as the number -1 Otherwise, encode this as the number 0 Store the result for each value into a list called num_type In [ ]. # YOUR CODE HERE raise NotImplementedError) In : assert isinstance(num_type, list) assert (len (num_type)len (data list) Show transcribed image text Q12 – Loops: Odd or Even (0.5 points) Write a for loop that is going to check whether the values in data_list are even or odd. Use a for loop with a conditional to do this. For each value, it should add True to a new list is_even if the value is even, and False to is_even if the value is odd In [ 1: | # rotR CODE HERE raise NotImplementedError) In : assert isinstance(is_even, list) assert (len(is_even)len (data list)) Q13- Loops: Multiple Conditions (0.75 points) Write a for loop that will check each value in data_list to see if they are even or odd and whether they are positive or negative. If they are both positive and even, encode this as the number 1 If they are both negative and odd, encode this as the number -1 Otherwise, encode this as the number 0 Store the result for each value into a list called num_type In [ ]. # YOUR CODE HERE raise NotImplementedError) In : assert isinstance(num_type, list) assert (len (num_type)len (data list)

Expert Answer


Answer to Q12 – Loops: Odd or Even (0.5 points) Write a for loop that is going to check whether the values in data_list are even o… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *