Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python [1] Write a function random_text(m) that returns a random text of n characters in upper-case characters. Use lorem-text as described in pypi.org/project/lorem-text/ and the

Python

[1] Write a function random_text(m) that returns a random text of n characters in upper-case characters. Use "lorem-text" as described in pypi.org/project/lorem-text/ and the function upper(). If you are using another programming language, please locate something equivalent.

[2] Write a function random_pattern(n, text) that returns a random pattern within the text. Generate a random index idx between 0 and len(text) - n, and then return text[idx:idx+n]. Remember that index so you can compare it to the index found by the search algorithms. (Generally n, the size of the pattern, will be small compared to m, the size of the text.)

from lorem_text import lorem 

import random

def random_text(m):

# need help fixing this

def random_pattern(n, text):

# need help fixing this

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago