1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elodia [21]
3 years ago
14

Create a function called notBad that takes a single argument, a string.

Computers and Technology
1 answer:
igomit [66]3 years ago
3 0

Answer:

The Following are the method definition to this question:

def notBad(s):#defining a method notBad that take s variable as parameter

   if 'not' not in s or 'bad' not in s: # defining If block that checks "not or bad" is not in the string

       return s#return string value

   n= s.index('not')#defining n variable that store index value of not

   b= s.index('bad')#defining b variable that store index value of bad

   if n<b:#defining if block that compare n and b value  

       return s[:n]+'good'+s[b+3:]#use slicling for remove value and add another value

print(notBad('This dinner is not that bad!'))#call method and print value

print(notBad('This movie is not that bad!'))#call method and print value

print(notBad('This dinner bad!'))#call method and print value

Output:

This dinner is good!

This movie is good!

This dinner bad!

Explanation:

In the above given, method definition a method "notBad" is defined that takes variable "s" as a parameter, which is used for input the string value.

In the next step, an if block, is defined, that checks in string value "not or bad" are not available in the input string. if the condition is true, it will return, that string value.

In the next line "n and b" variable has defined, that store "not and bad" index value, and use if block that the come to its value and use slicing to re remove its value.

You might be interested in
In terms of salary and wages, an applicant should:
Roman55 [17]
Address the issue to the employer after being hired.
7 0
4 years ago
What tag pair is used to link web page documents to each other?
V125BC [204]
<span><BODY> …</BODY>
It identifies the document's body area, which contains the Web page contents that appear in the browser window.
Hope this is the answer you are looking for.</span>
8 0
4 years ago
In a 4-bit opcode.What is the maximum number of instructions allowed in your instrction set or your PROM?
lara31 [8.8K]

Answer:

(c) 16

Explanation:

An opcode is the short form for operation code which is also called instruction code. This code forms part of the instructions (instruction set) executed by the computer and it tells the computer the actual operation to be performed. The size of the opcode is the number of bits occupied by it. It is related to the instruction set size as follows;

2ˣ = I   ----------------(i)

Where;

x = opcode size or bit

I = maximum or total number of instructions allowed

From the question,

x = 4 bits.

Substitute this value into equation (i) as follows;

2⁴ = I

I = 16.

Therefore, the maximum number of instructions allowed in your instruction set or your PROM - Programmable read-only memory - is 16

7 0
3 years ago
Ashton assigned a string value to a variable. Which program statement should he use?
ryzh [129]
The second one
bc it looks correct

6 0
3 years ago
Anyone know how to fix this problem on Microsoft Team?
lesya [120]

Answer:

Wait for some time and reload the page

Fix the corrupted file

The file is deleted before finishing upload

Clear browser cache.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • An online museum is creating a site hosting hundreds of thousands of digital representations of art from around the world. The w
    5·1 answer
  • Answer the following Python Interview questions • How is Python an interpreted language? • What is the difference between Python
    10·1 answer
  • When you don't have enough room to stop, you may _______ to avoid what's in front of you. A. speed up B. steer away C. brake
    7·2 answers
  • Write a program called DeliveryCharges for the package delivery service. The program should use an array that holds the 10 zip c
    10·1 answer
  • True or False. A modern programming EXE provides a text editor, a file manager, a compiler, a linker and loader, and tools for d
    9·1 answer
  • An employee who interacts with customers regarding the nature of their car problems, rather than actually working on the vehicle
    6·1 answer
  • The ____ command enables you to initialize the terminal display or terminal window, to place text and prompts in desired locatio
    14·1 answer
  • Google's Chrome OS integrates with web servers using cloud computing and storage to run applications and to perform other functi
    10·1 answer
  • Last bittttt of points
    8·1 answer
  • HELP ASAP <br>please will mark brainliest<br>​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!