Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 Write a function called 1337encode) that takes a string as an argument and returns a string in which the following substitutions have been

image text in transcribed

Problem 5 Write a function called 1337encode) that takes a string as an argument and returns a string in which the following substitutions have been made A or a 4 Borb> 8 Eore3 Sors5 Tort7 All other letters should be capitalized Note, there are several ways to solve this. The easiest uses string.replace,but for a greater challenge, solve this using a loop and comparisons, or a dictionary E.g.: 1337encode ("Bob s an eleet haxor") "808 15 4N 31337 H4XOR" Problem 6 Write a function called remove) that takes two strings as arguments: the source, and the token. The function should remove all instances of the token from the source string. Note The built-in string.replace) is particularly well suited to this task. For additional practice solve this problem using string.find) and string slices(:] instead E.g.: remove ("This is as it is.", "is" >'Th as it .' Problem 7 Write a function that takes a string s and an integer n as arguments. The function should then return the nth word from that string (or an empty string if no such word exists). As a bonus challenge, try solving this without the use of the str.split() method. For an even greater challenge, try solving it without the str.find) method as well E.g nthWord ("One two three four five six seven", 3)> 'three' nthWord ("Hello",3) >

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

=+16-5 Discuss how we are affected by subliminal stimuli.

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago