Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started