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 of the following is an example of new and emerging classes of software?
Rama09 [41]
The answer is Smart technology :)
4 0
3 years ago
List 5 items you should keep in mind when developing an app:
Mrac [35]

Answer:

  1. Agree on aims concerning the application.
  2. Read your end users.
  3. Take your IT partners toward the conversations in the beginning.
  4. Program for various announcements.
  5. Choose the technology which you know and will be able to continue.

Explanation:

You should always keep the above five points while developing an app. You should keep your goals in mind that what kind of app you are going to develop and you are taking surveys from end users that what they want after some time in different cycles. Your team should discuss your project time by time about the progress of an app. Your project should be a long term and should almost cover all kind of users.



6 0
3 years ago
Linda is the owner of Souvenirstop, a chain of souvenir shops. One of the shops is located at the City Centre Mall. Though the s
Klio2033 [76]

Answer:

attraction and attention

6 0
3 years ago
Describe how spacecraft evolved from the US Mercury to contemporary space shuttles.
pashok25 [27]

Answer:

Several of the subsystems evolved during the program through design changes: The parachute system, essential for booster recovery, was redesigned with larger parachutes in 1983. Frangible nuts, used in the space shuttle pad hold down and release system, were redesigned in 2008.

8 0
3 years ago
8. SQL, Oracle Report, and Visual Basic are all examples under the
sleet_krkn [62]

SQL, Oracle Report, and Visual Basic are all examples under the generation.

<h3>Fourth generation languages</h3>

Fourth-generation programming language (4GL) are computer programming language based on the advancement on third-generation programming languages (3GL).

4GLs may include support for <em>database management, report generation, mathematical optimization, GUI development, web development.</em>

SQL, Oracle Report, and Visual Basic are all examples under the generation.

Find out more on Fourth generation languages at: brainly.com/question/9325849

3 0
2 years ago
Other questions:
  • Where are Micro USB connectors used the most?
    11·2 answers
  • would specify that only selected members of the payroll and human resources department would have the right to change sensitive
    11·1 answer
  • The ________letter of the first word in the Complimentary Closing has a capital letter, everything else is keyed in lower case o
    8·1 answer
  • Which of the following sentences is accurate? a. PDF stands for "Proofreading Direct Files." b. PDF files cannot be edited. c. B
    9·1 answer
  • HELP PLSSS I WILL MARK U!!!!
    10·2 answers
  • Create a two functions: first called grocery_cost(food), where food can be one item or a list of items from the stock and price
    7·1 answer
  • A town government is designing a new bus system. The planners are deciding where to put the different bus stops. They want to pi
    6·2 answers
  • You have imported a library with the birthMonth() function. Based on the API, how many strings are inputed to calculate the birt
    11·1 answer
  • There's a rising issue with bots sending links starting with 'bit'. These links are dangerous and harmful for any computer or de
    6·2 answers
  • What do we call the software which programmers use to program?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!