1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lubasha [3.4K]
3 years ago
7

Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik

es to simulate. It should return a string containing that many characters, each one obtained from simulating a key strike by the monkey.
Computers and Technology
1 answer:
Furkat [3]3 years ago
7 0

Answer:

The solution code is written in Python 3

  1. import random
  2. import string
  3. def simulate_several_key_strikes(l):
  4.    char_set = string.ascii_lowercase
  5.    return ''.join(random.choice(char_set) for i in range(l))
  6. print (simulate_several_key_strikes(10))

Explanation:

The program is aimed to generate random characters and the number of characters generated is dependent on user input. Hence, we will need to import the random module (Line 1). We also import string module so that we can make use of its associated method to generate English letters (Line 2)

Next, we create the function simulate_several_key_strikes that takes one single parameter, l, as input. Within the function body, we use ascii_lowercase method to generate the lowercase letter set and assign it to char_set variable (Line 5). We use random.choice method to randomly pick one of the letter in char_set and join it with an empty string (Line 6). Please note there is a for-loop that will repeatedly generate l-number of character and eventually return it as output.

We test the function by passing 10 as input parameter and we shall get a sample output as follows:

xuiczuskoj

You might be interested in
In C++, objects instantiated on the stack must be returned to program memory through the explicit use of the delete keyword.
Lady_Fox [76]

Answer:

b. False.

Explanation:

Delete function not used to remove data stored on the stack. It is only used to free memory on the heap. The C++ is programming language used to develop operating systems.

8 0
3 years ago
Which computer are used by mobile employees such as meter readers.​
Naily [24]

Answer:

Handheld/Mobile Computers

3 0
3 years ago
Read 2 more answers
Well this isn't school related, but how do i watch dubbed and subbed anime for free on my computer?
Shtirlitz [24]
Crunchyroll or my anime list. Both of these work.

Hope this helps you

3 0
4 years ago
Read 2 more answers
need the answer ASAP. I’ll mark brainliest <br><br> they’re all the same options for each sentence.
KengaRu [80]

Answer:

Explanation:

pop(): Remove an item from the end of an array  

push(): Add items to the end of an array  

shift(): Remove an item from the beginning of an array  

unshift(): Add items to the beginning of an array

4 0
3 years ago
Entrepreneur Employing Mobile Enterprise Apps AACSB Standards: Systems and Processes Australian-based entrepreneur Nathan Tuckwe
insens350 [35]

The factor that is helpful when adding new inventory and not among the Accounting Functions is the audit function.

<h3>Why is the audit function important?</h3>

The role of internal audit is known to be one that tends to give some measures of independent assurance that is need by a firm or an organization in terms of risk management, governance, as well as internal control processes to be able to operate effectively.

Note that an internal audit is said to be carried out objectively and set up to improve and make good an organization's business practices.

Hence, The factor that is helpful when adding new inventory and not among the Accounting Functions is the audit function.

Learn more about audit function from

brainly.com/question/24170807

#SPJ1  

4 0
2 years ago
Other questions:
  • Robin maintains a web page for updating the metro timings in the city. He would like the website to display the present day's sc
    6·1 answer
  • Your mobile device files can be synchronized using ________. hdmi a secure digital transmission a display adapter a cloud servic
    11·1 answer
  • Unlike a virtual image, a real image
    7·1 answer
  • Any file that contains data but not instructions for your computer is not considered software
    7·1 answer
  • The _____ element, a hypertext markup language (html) metadata element, contains a collection of metadata elements that describe
    11·2 answers
  • Which button would you use to quickly add addresses to a mail merge envelope?
    5·1 answer
  • Which component of service-oriented DSS can be defined as data that describes the meaning and structure of business data, as wel
    9·1 answer
  • 2) A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long
    7·1 answer
  • Watson Studio is the IBM premier integrated development environment for data science and artificial intelligence practitioners.
    5·1 answer
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!