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]
2 years ago
14

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

Computers and Technology
1 answer:
igomit [66]2 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
(100 points ASAP PLease) Type the correct answer in the box. Spell all words correctly.
Katena32 [7]

Answer:

Maria can ensure that the video is recording correctly by checking the _____. 1. See answer.

8 0
2 years ago
A company that designs video games has decided to expand and needs to hire Software Developers, Web Administrators, and Computer
choli [55]
Collage graduates that are currently jobless or looking to apply for a jod
8 0
2 years ago
Read 2 more answers
What is the function of ROM?
Gnoma [55]

Answer:

Hello, There!

<h2>Your Question↓</h2>

What is the function of ROM?

<h2>Answer↓</h2>

Allows parts of the computer to communicate is the Correct Answer.

Explanation:

<h2>Now you May Ask What does it do or How it works↓</h2>
  • ⇒ROM provides the necessary instructions for communication between various hardware components.
  • ⇒ it is essential for the storage and operation of the BIOS, but it can also be used for basic data management, to hold software for basic processes of utilities.

Tip: Wanna know how to earn points back for asking your Question?

If you do it's easy just when two people answer your question whichever answer you think is the best click the crown on the side to get 25% of your points back! :D

Therefore, I hope this helps!

6 0
2 years ago
You are configuring a wireless network with two wireless access points. Both access points connect to the same wired network. Yo
-BARSIC- [3]

Answer:

b. Same SSID, different channel

Explanation:

The Service Set Identifier (SSID) is a sequence that is included in all of the sets in a wirless network and helps identify them as part of the network. Because both points connec to the same network they need the same SSID.

7 0
3 years ago
What does NBT stand for?​
Zanzabum

Answer:

National Benchmark Test

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following is an encryption tool that allows users to encrypt files and folders by simply right-clicking a given obj
    10·2 answers
  • In the late 1980s, which wide area network (wan) technology became one of the standard methods of connecting business computers
    11·1 answer
  • In general, font size for software-generated presentation slides should be no smaller than __________ points.
    8·1 answer
  • Write a C# program named DoubleDecimalTest thatdeclares and displays two variables - a double and a decimal.Experiment by assign
    9·1 answer
  • What<br>are<br>the features of secondary storage media​
    13·2 answers
  • Write a program for determining if a year is a leap year. In the Gregorian calendar system you can check if it is a leaper if it
    15·1 answer
  • PLEASE HELP I WILL GIVE BRAINLIEST!!!!
    7·2 answers
  • What is this....... Iam booking train to patna. ​
    13·2 answers
  • In 3-5 sentences describe to me in detail how you can make a change and better our online community. What are steps would you ta
    8·2 answers
  • An operating system with _____ capabilities allows a user to run more than one program concurrently.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!