Home / Questions / Write a program that reads a list of integers, and outputs whether the list contains all even number
Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers that follow. Ex: If the input is 6 10 the output is all even Ex: If the input is T the output is all odd Ex: If the input is: 5 2 4 the output is not even or odd Your program must define and call the following two functions. is list even) returns true if all integers in the list are even and false otherwise. is list odd0 returns true if all integers in the list are odd and false otherwise. def is list_even (my_list) def is liat odd (my 1ist) Instructor note: Define the is list evenmy list) and is list odd(my list) functions at the top then place your test code (that will gather user input, call the methods, and output the result) INSIDE the existing if statement. The check for is needed because the zyLab will perform a unit test of your method, importing this file as a module and call name ing the function directly. main__means your code is being executed directly and needs the input/output to execute. Otherwise, it is being imported and your test code won't need to run at all. LAB 6.22.1: LAB: Even/odd values in a list 6/10 ACTIVITY main.py Load default template... 1 Define your function here 2 3 if main' name 4 Type your code here. Nm n un e n
Apr 02 2020 View more View Less
Sarah and James Hernandez purchased 230 shares of Macy’s stock at $40 a share. One year later, they sold the stock for $80.00 a share. They paid a broker a commision of $...
Apr 05 2021Match the terms to changes presented, assuming a resting membrane potential of -70 mV. Answers may be used once, more than once, or not at all.A. electrical polarizationB...
Dec 16 2019qiesiisiinttheaattachedffile
Jun 30 2020Human behavior, like other mammalian behavior, is determined (A) Strictly by the genes (B) Strictly by learning (C) By a mixture of genes and learning (D) None of the above
Mar 20 2018National Bank currently has $500 million in transaction deposits on its balance sheet. The current reserve requirement is 10 percent, but the Federal Reserve is decreasin...
May 18 2020Discuss Frequency conversion and explain the functionality of mixers in the conversion of audio signals.
Apr 15 2020Wallton Corporation owns 70 percent of the outstanding stock of Hastings, Incorporated. On January 1, 2009, Wallton acquired a building with a 10-year life for $300,000. ...
Jul 11 2020Debra Ferguson received the following items and amounts of income during 2014. Help her calculate (a) her gross income and (b) that portion (dollar amount) of her income ...
Apr 01 2020Use Worksheet 5.2. Rosa Ramirez is currently renting an apartment for $725 per month and paying $275 annually for renter’s insurance. She just found a small townhouse she...
May 17 2020Editorial essay with 5 paragraphs that states a clear thesis statement and uses emotionally charged words, parallelism and repetition. It also has to have a counter claim.
Feb 15 2020