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
Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
expeople1 [14]

Answer:

D. Attention getters

Explanation:

Based on the answers provided within the question it can be said that in both a speaking outline and a preparation outline you should include attention getters. These are important to include in both because it needs to be practiced and perfected in order to catch the audiences attention and hook them on to what you are saying.

4 0
3 years ago
To ease giving access to network resources for employees, you decide there must be an easier way than granting users individual
scoundrel [369]

Answer

The intranet security model

Explanation:

This is an enterprise system that processes user information for security  and access authentication. It prevents unauthorized users, who are not part of the network resources from capturing these information.

The intranet security model is an efficient security procedure that incorporates web security  access control in keeping information safe over the intranet. It is also useful in encryption and decryption techniques.

4 0
3 years ago
Given this method comment, fill in the blank in the method implementation. /* Deposits money into the bank account amount: the a
DIA [1.3K]

Answer:

"void" is the correct answer for the given question.

Explanation:

In the function body the value of balance variable is not return that means we use void return type .The void return type is used when the function does not return any value .

If the function are  int return type that means it return "integer value ".

if the function are  double return type that means it return the "double value" .

The complete implementation of this method is

public void deposit(double amount) // function definition  

{

balance = balance + amount; // statement

}

3 0
3 years ago
C++
vichka [17]

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

4 0
3 years ago
During data declaration, a name is binded to a memory location, what else can be identify as part of this process?
igomit [66]

data declaration means a variable which contain data value and it can be declared as integer, float, character, double, boolean (data types).

example:

int r;

char name;

float g;

double k= 23.34;

5 0
3 years ago
Other questions:
  • DRU is a small brokerage house that enables its clients to buy and sell stocks over the Internet, as well as place traditional o
    11·1 answer
  • How is informatics affecting banking and financial institutions?
    13·1 answer
  • What is the part of the browser window that displays the content of the web page such as pictures and text called?
    10·1 answer
  • Which of the following is no longer necessary when you use HTML5 to develop Webpages? Please Hurry This Is For An Assignment due
    13·1 answer
  • Explain the use of keyboard shortcuts and key combinations. You are at the tenth page of a 20-page document. You need to make ch
    14·1 answer
  • Now tell me how be rich like Bill Gates
    6·1 answer
  • The signature of a function is determined by
    5·1 answer
  • Which process centers the spreadsheet's content on the page?
    15·1 answer
  • g How safe is to have a LinkedIn account where you have published all the important information about yourself
    13·2 answers
  • Wha are the types of slide show? define​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!