QuestionHow many parameters go into the function sum, and how many return values come out of the function sum? 3 parameters go in, 1 return value comes out 3 parameters go in, 3 return values come out 1 parameter goes in, 4 return values come out…
Read more →QuestionWhat is printed by the following program? def print_numbers(two, one, zero): print(two) print(one) print(zero) zero = 0 one = 1 two = 2 print_numbers(zero, one, two) 0 1 2 0 1 2 zero one two two one zero
Read more →QuestionWhat is the output of the following program? def sum_to(num): sum = 0 for i in range(num+1): sum += i print(sum) x = 5 sum_to(x) print(x) 5 15 15 5 5 15
Read more →QuestionWhat is the parameter of the function? print_three_times def print word
Read more →QuestionWhy do we write functions? I. Make our code easier to understand by giving a readable name to a group of instructions II. Avoid writing repeated code III. Make our code reusable II and III I only I and II I, II, and III
Read more →QuestionThe box plots shown represent two data sets. Use the box plots to compare the data sets. Drag each value to show if it is the same for both data sets, different for each data set, or if there is not enough information to tell. Median IQR…
Read more →QuestionWrite a program that prints out the numbers in the Fibonacci sequence up until the max number. You can figure out the next number in the Fibonacci sequence by adding the two previous numbers. The first number is 1 and the second number is…
Read more →QuestionA student is creating a Web site that is intended to display information about a city based on a city name that a user enters in a text field. Which of the following are likely to be challenges associated with processing city names that…
Read more →QuestionUpon compiling the data, the researcher identifies a problem due to the fact that neither data source uses a unique ID number for each student. Which of the following best describes the problem caused by the lack of unique ID numbers? A.…
Read more →QuestionA team of researchers wants to create a program to analyze the amount of pollution reported in roughly 3,000 counties across the United States. The program is intended to combine county data sets and then process the data. Which of the…
Read more →QuestionWhich of the following explains how the two databases can be used to develop the interactive exhibit? A. Only the first database is needed. It can be searched by animal name to find all the information to be displayed. B. Only the second…
Read more →QuestionA student wants to count the number of shows that meet both of the following criteria. Is a talk show Is on Saturday or Sunday For a given row in the spreadsheet, suppose genre contains the genre as a string and day contains the day as a…
Read more →QuestionIf added to the program below, which of the following additional functions would not cause an error? def subtract_nums(): z = x – y print z def subtract_nums(): z = z – x print z def subtract_nums(): y = 5 z = x – y print z def…
Read more →Questionx = 10 def add_nums(): y = 2 z = x + y print z Function namespace Global namespace Object namespace Class namespace
Read more →QuestionWrite a function called is_even that takes one parameter and returns a boolean value. It should return True if the argument is even; it should return False otherwise. The is_even function should not print anything out or return a number.…
Read more →Questiondef sum(first, second): result = first + second return result What is the output of this function given the choices below? 0 1 2 3
Read more →QuestionYour code should use a for loop. Your code should ask the user for input. With input 90, 30, and 30, the average should be 50. With input 200, 800, and 200, the average should be 400.
Read more →QuestionYour code should use a for loop. Your code should ask the user for input. With input 90, 30, and 30, the average should be 50. With input 200, 800, and 200, the average should be 400.
Read more →QuestionFor this activity you will use functions, loops, if statements, input statement and variables. You will also add comments to each section. Create a flower and stem. The flower will be dependent on user input for the number of petals,…
Read more →QuestionWrite a program that rolls two dice until the user gets snake eyes. You should use a loop and a half to do this. Each round you should roll two dice (Hint: use the randint function!), and print out their values. If the values on both dice…
Read more →