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
Crazy boy [7]
3 years ago
8

Write a program that print "Censored" if userInput contains the word "darn", else print userInput. End with newline.

Computers and Technology
1 answer:
Ainat [17]3 years ago
7 0

Answer:

userInput = input("Please enter a string of words ")

userInput.split ()

for item in userInput.split ():

   if item =="darn":

       print("Censored")

       break

else:

   print(userInput)

Explanation:

Using Python programming language, the input function is used to receive the users input and save in a variable userInput

Then the .split method is used to convert the words into a list of words.

Using a for loop, the code checks for the word darn and prints censored if it exists else it prints the userInput

You might be interested in
What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible
meriva

Answer:

Move the duplicated code outside of the if statement

5 0
3 years ago
What does DKIM stand for?
zheka24 [161]
Domain Keys Identified Mail is the answer:)
4 0
3 years ago
Read 2 more answers
Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with a
tekilochka [14]

Answer:

The following are the program to the given question:

import java.util.*;//import package for user input

public class Make  //define class Make

{

public static void main(String[] ask)  //define a main method

{

  Scanner obx = new Scanner(System.in);   //declare the Scanner class object

  int size=obx.nextInt(); //get the size of the array from the user

  int a[]=new int[size]; //declare an integer array with given size

  String word[]=new String[size]; //declare a string array with given size

  for(int i=0;i<size;i++) //set the for loop  

  word[i]=obx.next(); //get string input from the user

  for(int i=0;i<size;i++)   //iterates with the array, increase the count

  {

    for(int j=0;j<size;j++)   //defining a loop to check value

    {

      if(word[i].equals(word[j]))  //use if to check that elements of words          

      a[i]++;//increamenting array size

    }

  }

 System.out.print("\n");  //use print for break line  

  for(int i=0;i<size;i++)//set for loop to print the following result

    System.out.println(word[i]+" "+a[i]);//print value

 }

}

Output:

Please find the attachment file.

Explanation:

  • First, establish the predefined package required and instead define the main class and define the main method within the class and method.
  • Declare the scanner class object and receive an object size in the 'size' variable thru the array.
  • Next create two arrays, the integer type "a" with both the input size given and the string type "word" with the input size supplied.
  • Define the loop for which string array elements are acquired and set two to again for loop, which increases with loop iteration the integer data type array by one.
  • Lastly, set the loop for which this result is printed.

5 0
3 years ago
Im timed!!!!!!!!!!!!!!!!!!<br><br> I NEED HELP ASAP<br> THANK YOU SO MUCH
Troyanec [42]

Answer:

card sorting

Explanation:

tell me if im wrong...

6 0
3 years ago
Read 2 more answers
This is gonna be very long but I have no idea what to do, I'm confused.
kaheart [24]

for such experiment, you do it with care and to acquire and determine to put experience in it

Explanation:

because without you been or using experience the experiment will not correct

8 0
2 years ago
Other questions:
  • What is binary in computer science ​
    11·1 answer
  • The biggest factor in determining the price of a mortgage is:
    14·1 answer
  • A broadband router is used to do which of the following? run the programs on a computer locate lost files on a computer manage a
    6·1 answer
  • To reboot a pc, hold down the ____ keys at the same time.
    15·1 answer
  • Henry went to an IT software company for an interview he was offered a position in lower level management which positions could
    11·1 answer
  • ALGUEM SABE COMO MUDA O NOME DE PERFIL!?!?!? SE SOUBER ME AJUDA!!
    14·1 answer
  • - Which amongst the following is not a Characteristic of Cloud Computing?
    5·1 answer
  • In _____, a program running on a Web server creates a Web page in response to a request for specific information from a Web clie
    7·1 answer
  • Paula weeded 40% of her garden in 8 minutes. How many minutes will it take to weed all of her garden at this rate ?
    7·1 answer
  • Write a recursive, string-valued method, reverse, that accepts a string and returns a new string consisting of the original stri
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!