Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

your answer document: 16 17 18 19 6. length index nums length [2, 6, 4, -8, 1] = len(nums) I for index in range(length): print(nums

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
your answer document: 16 17 18 19 6. length index nums length [2, 6, 4, -8, 1] = len(nums) I for index in range(length): print(nums (index]) Output: 7. Length index EL 4 - 71819 10 12 13 15 16 17 18 19 7. I X= X length index y = @ nums length [2, 6, 4,-8, 1] = len(nums) for index in range(length): if nums[index] % 2 == 0: X = X + 1 else: y = y + 1 print("x +", X, "y -", y) Output: TRU im HE / 4 00%- 10: Arial 12 + B do YUA 67 2 1 1 > 2 3 4 5 19 12 13 8 9 10 11 15 16 17 18 19 nums = [2, 6, 4, -8, 1) index low: for index in range(len(nums)): print(index, nums [index] * 2) Output: 9. Describe the error in the function below? Open the Python program to fix the error, including the main() module take a screenshot of the code and output and copy into your answer document // This function is passed an integer array, nums and returns the 11 index of value, or -1 if not found def findValue (nums, value) : Index - 0 length len (nums) for index in range (length) it numindex Value: return index s and Arrays (2) 0 : TV Arial 12 + B TUA GO - E 15 9 10 11 12 13 III 2 2 2 3 4 5 67 , 15 16 17 18 19 10. Open this Repl.it which prompts for name and appends it to a list. Write the code to print out *the list of names with a Hello message after the user enters 'quit'. Take a screenshot of the code and output of a run, and copy into your answer document. Sample run (user input is in blue) Enter name for quit to stop): Righika Enter name for quit to stop): Luis Enter name for quit to stop): Zaria Enter name for quit' to stopy: Frank Enter name (or quit' to stop) : Tragi Enter name (or quit! to stop) quit Hello, Rishika! Hello, Luis! Bello, torial Hello, Frank! Hello, Traci

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions