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
Nat2105 [25]
3 years ago
14

O

Computers and Technology
1 answer:
BaLLatris [955]3 years ago
3 0

The program written in python 3 which randomly removes one alphabet from a string and returns the new string is written thus:

import random

<em>#import</em><em> </em><em>the</em><em> </em><em>random</em><em> </em><em>module</em><em> </em>

def rand_minus(s):

<em>#initialize</em><em> </em><em>a</em><em> </em><em>function</em><em> </em><em>named</em><em> </em><em>rand_minus</em><em> </em><em>which</em><em> </em><em>takes</em><em> </em><em>on</em><em> </em><em>one</em><em> </em><em>parmaters</em><em>,</em><em> </em><em>which </em><em>is a</em><em> </em><em>string</em><em> </em>

minus_1 = random.sample(s, len(s)-1)

<em>#using</em><em> </em><em>the</em><em> </em><em>sample</em><em> </em><em>method</em><em> </em><em>in the</em><em> </em><em>random</em><em> </em><em>module</em><em>,</em><em> </em><em>randomly</em><em> </em><em>select</em><em> </em><em>alphabets</em><em> </em><em>which is</em><em> </em><em>one</em><em> </em><em>lesser</em><em> </em><em>than</em><em> </em><em>the</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>alphabets</em><em> </em><em>passed</em><em> </em><em>in</em><em>.</em><em> </em>

new =''

<em>#initialize</em><em> </em><em>an</em><em> </em><em>empty</em><em> </em><em>string</em><em> </em><em>named</em><em> </em><em>new</em><em> </em>

for alp in minus_1:

<em>#loop</em><em> </em><em>through</em><em> </em><em>the</em><em> </em><em>randomly</em><em> </em><em>selected</em><em> </em><em>alphabets</em><em> </em><em>in the</em><em> </em><em>list</em><em> </em>

new+=alp

<em>#place</em><em> </em><em>each</em><em> </em><em>alphabet</em><em> </em><em>in</em><em> </em><em>the</em><em> </em><em>empty</em><em> </em><em>string</em><em> </em><em>created</em><em> </em>

return new

<em>#return</em><em> </em><em>the</em><em> </em><em>string</em><em> </em><em>in the</em><em> </em><em>new</em><em> </em><em>variable</em><em>.</em><em> </em>

<em>#</em><em> </em><em>A</em><em> </em><em>sample</em><em> </em><em>run</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>and</em><em> </em><em>its</em><em> </em><em>output</em><em> </em><em>are</em><em> </em><em>attached</em><em> </em><em>below</em><em>.</em><em> </em>

old = 'ABEFCD'

print(rand_minus(old))

Learn more :brainly.com/question/25210352

You might be interested in
The ________ contains the central electronic components of the computer. select one:
Sati [7]
The motherboard contains the central electronic components of the computer.
6 0
3 years ago
An information system will be developed to keep track of a utility company's assets, such as buildings, vehicles, and equipment.
Daniel [21]

The four standard layers of a layered architecture are:

  • presentation,
  • business,
  • persistence,
  • database.

<h3>What is a Layered Architecture?</h3>

This refers to the architectural style that is used to show components with similar functions in horizontal layers that have specific roles.

Hence, we can see that no generic info system architecture was attached to the answer, so it would be impossible to create a layered architecture, so a general overview was given about layered architecture.

Read more about layered architecture here:

brainly.com/question/2563702

#SPJ1

8 0
2 years ago
8. Which of the following is an output device
Fynjy0 [20]
<h2>Hey there!</h2>

<h3>Printer is an output device. </h3>

<h2>Explanation:</h2>

<h3>CD - We insert CD,so it is an input device.</h3>

<h3>Hard Drive - It is responsible for the memory of the computer, so it also an input device. </h3>

<h3>Joystick - It is used to play games on a computer, it inputs instructions through which a game/games can be played. So,it an input device.</h3>

<h3>Printer - It is used to print out the hard copies from a computer,like pages etc..</h3>

<h2>Hence, the correct option will be </h2>

<h3>D. printer </h3>

<h2>Hope it helps </h2>

7 0
2 years ago
Set the Append Only property to _____ to allow users to add data to a Long Text field but not to change or remove existing data.
diamong [38]

A computer data storage is made of many features. Set the Append Only property to YES to allow users to add data to a Long Text field but not to change or remove existing data.

  • Append-only is known to be a characteristic or component of computer data storage. It is where new data can be appended to the storage, but where existing data is said to be immutable.

A field's data type is very essential property as it shows what kind of data the field can store.

Learn more from

brainly.com/question/24795103

7 0
3 years ago
Which of the following organizes the commands available in tabs and groups?
xxMikexx [17]

Answer: Ribbon

Explanation:

5 0
3 years ago
Other questions:
  • A ____ is any manipulation of data, usually with the goal of producing information.
    9·1 answer
  • 50 pts
    12·2 answers
  • NEED HELP AGAIN
    11·2 answers
  • Simon is producing a report on major rivers in North America. In the report he wants to add a table that displays the statistics
    12·1 answer
  • USE THIS CODE ON FETCH REWARDS FOR BRAINLIEST​ Also I will be doing a gift card giveaway for the ppl that use my code ​
    6·2 answers
  • Given the code as follows: main() { int i = 3, n; float x; x = i; n = 8 % x; } What problem will occur? Group of answer choices
    12·1 answer
  • Write a C program to find the sum of 10 non-negative numbers entered by user​
    14·1 answer
  • Serena, an analyst at an environmental agency, wants to prepare a report using data from the Car Emissions database.
    11·2 answers
  • Hola busco ya saben nv por fa no sean malos nunca e tuvido una ni se como se siente el amor
    5·2 answers
  • Make and run a Python program which:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!