Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi there! Please give me the answers of these question. And make sure to answer all of its parts. Please Solve it only if you're

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Hi there! Please give me the answers of these question. And make sure to answer all of its parts.

Please Solve it only if you're sure that your answer is 100% correct otherwise let any other person to solve it.

I need the Correct answet please otherwise I'll give dislike and report it to the Chegg authorities. Sorry for these words but I'm tired of getting lots of wrong answers lately.

Please answer it as soon as possible! No explanation needed. Quick please

Consider the following fragment of a function definition. def substitute(target, replacement, alist) Purpose: ??? Pre-Condition(s): ??? Post-Condition(s): ??? Return(s) : ??? For each of the fragments below, choose where that fragment should belong in the interface documentation above. This function produces a new list containing all the values in a given list, but all occurrences of the given target are replaced by a replacement. target: a value to be replaced, replacement: a value to replace the target value, alist: a list of values None A new list with each occurrence of target replaced with replacement. Post-Condition(s): ??? Return(s): ??? For each of the fragments below, choose where that fragment should belong in the interface documentation above. This function modifies the given list by replacing all occurrences of the given target by a given replacement. target: a value to be replaced, replacement: a value to replace the target value, alist: a list of values The list is modified by replacing the target with the replacement value. Consider the following interface documentation for a function count_if() Purpose: This function counts the number of times the target appears in the given list Pre-Condition(s): target: a value to be counted alist: a list of values Post-Condition(s): None Return(s): The number of times the target appears. Which is the correct way to call this function? target =1 alist =[1,2,3,4,5] count if 0 print(count) Neither of the other anwsers is correct. \[ \text { count = count_if }(1,[1,2,3,4,5]) \] If a function contains a print () statement, then the function's interface should mention that the function performs console output under its: Purpose Pre-conditions Console output does not need to be mentioned in the interface. Return Post-conditions

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions