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]
2 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]2 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
You are creating a program that can add up the amount of money the user spent that day. Right down to the penny! What kind of va
padilas [110]

Answer:A. A default Variable

Explanation:

5 0
2 years ago
Read 2 more answers
What provision of the Government Paperwork Elimination Act was designed to encourage a paperless society?
Ratling [72]
<span>Validation of electronic signatures was designed to encourage a paperless society.</span>
8 0
3 years ago
Read 2 more answers
What should be the extension to execute files?
Ganezh [65]
The correct answer is D. All of the above. Each of these extensions are able to execute files depending on what type of information the file contains.
5 0
3 years ago
A ____ error occurs when the javascript interpreter encounters a problem while a program is executing.
Leya [2.2K]
It is a runtime error thart occurs when <span>the javascript interpreter encounters a problem while a program is executing.</span>

5 0
3 years ago
3. Do some Internet research on the use of VLANs in hospitals. Summarize the benefits of using VLANs in hospitals and identify e
motikmotik

VLAN refers to Virtual Local Area Network. It is a subnetwork that can group together collection of devices on separate physical Local Area Networks. VLANs allow network administrators to group hosts together even if the hosts are not directly connected to the same network switch.

Considering the large number of departments in hospitals, with each departments having functions different from the others, Virtual LANs allows various users(the departments) to be grouped together according to their networking needs, regardless of their actual physical locations. Subdividing the LAN into smaller segments, or VLANs, increases overall reliability, security, and performance, and makes the network easier to maintain.

Because of the largeness of St. Luke's hospitals and their mission of delivering highly reliable and feature-rich advanced network solutions, virtual LAN will help to provide a resilient and scalable network solution within the hospital's budget.

St. Luke should implement virtual LAN that can produce a higher bandwidth with lower-cost, a longer-term model based on servers, networking products and homogenous network components to deliver centralized management of computing across the hospital network.

5 0
3 years ago
Read 2 more answers
Other questions:
  • If you want the date in your document to update each time the document is opened, _____.
    9·2 answers
  • Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to
    10·1 answer
  • "Technician A says that Ohm's law can be used to determine circuit current flow if total circuit resistance and total voltage ar
    14·1 answer
  • Your boss wants to utilize some sort of cloud storage for his files so that all of his
    10·2 answers
  • A colleague asks you to research a CPU for a new server that will run Windows Server 2019. He explains the server roles that he
    7·1 answer
  • To what would you compare the transport layer?
    14·1 answer
  • The communication channel used in IMC must rev: 12_06_2018_QC_ CDR-223 Multiple Choice match the traditional channel used in tha
    14·1 answer
  • To change the way a slide moves from one slide to the next, what tab should be selected?
    12·1 answer
  • Upon connecting to a Wi-Fi network, you're redirected to a login screen and a request to accept terms of service before being co
    15·1 answer
  • A video consists of a sequence of:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!