Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

blockpy questions for assignment 25.3-25.6 (PYTHON) asking about function development Server Saved Execution: ldle BlockPy: #253) String Extraction The expression below extracts the first half

blockpy questions for assignment 25.3-25.6 (PYTHON) asking about function development

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Server Saved Execution: ldle BlockPy: #253) String Extraction The expression below extracts the first half of a string by using the len built-in function to calculate the end of the string, halving that length, and then converting the result to an integer (recall that division results in a float). Extract this expression into a function named get_half and replace the existing expressions with function calls There is an example available for this question. Console Ban ABC Half Feedback: Instructor Feedback No function named get_half was found. Incorrect Answer (missing_func_get_halt) Run BlocksSplitTextReset UploadZ History 1print("Banana"[:int(len( "Banana")/2)1) 2 print("ABCDEFG"[:int(len("ABCDEFG")/2)]) 3 print("alf & Half"[:int (len("Half & Half")/2)1) BlockPy: #25.4) Igpay Atinlay Write a function to pig.latin that converts a word into pig latin, by Server: Saved Execution: Idle 1. Removing the first character from the start of the string 2. Adding the first character to the end of the string, 3. Adding "ay" to the end of the string. So, for example, this function converts "hello" to "ellohay". Call the function twice to demonstrate the behavior. There is a worked example for this kind of problem. Console Feedback: Ready Run BlocksSplitTextCReset UploadZ History BlockPy: #25.6) Misleading Words In the real world, it is easy to be fooled by the description of a problem into thinking that you must use a certain function or method, just because you see a certain word. Keep that in mind for this problem Server: Loaded Execution: Idle Write a function hide_letter that replaces the first character of a string with the symbol "?".So "Apple" will become "?pple". Call this function twice. Console Feedback: Ready Run BlocksSplitTextReset UploadZ History

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

More Books

Students also viewed these Databases questions

Question

Classify delivery styles by type.

Answered: 1 week ago