Question

Complete the code so that the program makes the expected output. Use no more than one...

Complete the code so that the program makes the expected output. Use no more than one word in the blank.

Expected output: adam_smith

for ch in "[email protected]":

if ch == "@":

_________

print(ch, end="")

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer to the question is given below.

At blank space, we have to write break.
It will terminate the for loop when ch is @

The python code is given below.

for ch in "[email protected]":
   if ch=="@":
       break
   print(ch,end="")

The screenshot of the running code is given below.



The screenshot of the output is given below.





If the answer helped please upvote it means a lot. For any query please comment.


  


Add a comment
Know the answer?
Add Answer to:
Complete the code so that the program makes the expected output. Use no more than one...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Complete this task4.s ARM assembly code to produce an assembly program that: • Waits for the...

    Complete this task4.s ARM assembly code to produce an assembly program that: • Waits for the user to enter two integers (this part is already coded in). • Places the first integer at r5, and the second integer at r6 (this part is already coded in). • (This is what you need to code in) Adds the two integers together. If the result is between 0 and 9 (including 0 and 9) the program should print the result. If not,...

  • Make a Complete Code in C++ language. Create a Complete program of Tower of Hanoi. Write...

    Make a Complete Code in C++ language. Create a Complete program of Tower of Hanoi. Write the code in easy way means coding should of beginner level. Also use more and more comments in the code for better understanding. The code should complete and should able to run. Also provide output of the program.

  • Python Error: Writing a program to complete the following: Prompt the user for the name of...

    Python Error: Writing a program to complete the following: Prompt the user for the name of an input file. Open that file for input. (reading) Read the file using a "for line in a file" loop For each line,  o print the line and compute and print the average word length for that line. Close the input file Sample output: MY CODE IS WRONG AND NEED HELP CORRECTING IT!!! ------------------------------------------------------------------------------------------------------------------------ DESIRED OUTPUT: Enter input file name: Seasons.txt Thirty days hath September...

  • This program should be written in C Thoroughly following the Code Conventions, write an efficient program,...

    This program should be written in C Thoroughly following the Code Conventions, write an efficient program, which ask the user for their numeric grade, and determines and displays the equivalent letter grade, based on the following information: Use appropriate data types and initialize the variables correctly Use the following grading scale: A: 90 - 100 B: 80 - < 90 C: 70 - < 80 D: 60 - < 70 F: 0 - < 60 If the input is invalid,...

  • Code the following program in C so that the example executions match the output of your...

    Code the following program in C so that the example executions match the output of your code. CANNOT USE LOOPING CONSTRUCTS OR RECURSIVE FUNCTIONS. ALSO CANNOT USE STRINGS.

  • Make a Complete Code in C++ language. Create a Complete program of Tower of Hanoi using...

    Make a Complete Code in C++ language. Create a Complete program of Tower of Hanoi using stack implementation. The code should not copied means code should unique. Code should not copy paste from any where. Write the code in easy way means coding should of beginner level. Also use more and more comments in the code for better understanding. The code should complete and should able to run. Also provide output of the program. ( 1 ) Code should not...

  • C++ program: can you help create a autocorrect code using the cpp code provided and the...

    C++ program: can you help create a autocorrect code using the cpp code provided and the words below using pairs, vectors and unordered map: Objectives To practice using C++ std::pair, std::vector, and std::unordered_map To tie together what we've learned into the context of a real-world application used by millions of people every day Instructions For Full Credit You're given a short list of words in known_words_short.txt that contains a handful of very different words. Assume this short list of words...

  • The program needs to be written in C. Write a function void camelCase(char* word) where word...

    The program needs to be written in C. Write a function void camelCase(char* word) where word consists of more than two words separated by underscore such as “random_word” or "hello_world_my_name_is_sam". camelCase() should remove underscores from the sentence and rewrite in lower camel case” (https:// en.wikipedia.org/wiki/Camel_case). Watch out for the end of the string, which is denoted by ‘\0’. You have to ensure that legal strings are given to the camelCase() function. The program should only run when the input is...

  • Please use C++ and include source code and a picture of program output. You are required...

    Please use C++ and include source code and a picture of program output. You are required to write a C++ program that interactively reads three integers, adds the numbers, and prints the result. 1- The program should use a class and an object. 2- The program can use a public function such as int FindSum (int , int y, int z) to calculate the sum of the numbers. 3- The main function should read the numbers and passes them to...

  • C++ : Please include complete source code in answer This program will have names and addresses...

    C++ : Please include complete source code in answer This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record. When the program is run, it will search for a birthday or an anniversary using the current date to compare with the saved date. It will then generate the appropriate card message. Because this will be an interactive system, your program should begin by displaying a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT