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
mixas84 [53]
3 years ago
7

What is the missing line of code?

Computers and Technology
1 answer:
Ray Of Light [21]3 years ago
5 0

Answer:

phrase[2:5]

Explanation:

Given:

The above code segment

Required

Which instruction returns 'u a'

First, we need to get the index of u in the phrase:

u is at the third position but in programming, index starts at 0.

So, u is at index 2

Next, we need to get the index of a in the phrase:

a is at index 4

One of the ways to return a sub string from a string in python is string[start:stop+1]

Where:

start = 2 ----- index of u

stop = 4  ----- index of a

phrase ---- The string variable

So, the instruction that returns 'u a' is: phrase[2:5]

<em>Where 5 = 4 + 1</em>

You might be interested in
which computer career field enables you to create and design interactive multimedia products and services
dusya [7]
I think its graphic design 
4 0
3 years ago
Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text
leonid [27]

Answer:

Total number of character comparison = 43

Explanation:

Using the Brute force algorithm

The string of n characters is known as text, and the string of m characters is known as the pattern.

From the given information:

The text (n)=THERE_IS_MORE_TO_LIFE_THAN_INCREASING_ITS_SPEED

The pattern (m) = GANDHI

The total no of characters that we have in the text = 47

The total number of characters in pattern = 6

For a brute force algorithm;

Since; the first character of the pattern does not exist in the text, then the number of trials made can be attempted can be expressed as = n – m + 1

= 47 – 6 + 1

= 47 – 5

= 42

Thus; the algorithm will attempt the trial 42 times.

Now, for loop in the algorithm to run 42 times, the G in the pattern will have to align against the for T in the text, and in the last case, it will be aligned against the last space.

On each attempted trial, the algorithm will make one unsuccessful comparison.

However, at the trial at which the G in the pattern Is aligned with the G in the text, there will be two successful comparisons.

Hence, we can calculate the total number of character comparison as follows:

Total number of character comparison = \mathbf{\bigg ( ( 42 -  (no. \ of \  failed \ comparison) ) \times 1 + (1 \times ( Two \ successful \  comparisons) ) \bigg ) }

Total number of character comparison = ( (( 42 – 1) × 1 ) + ( 1 × 2) )

Total number of character comparison = 41 + 2

Total number of character comparison = 43

3 0
3 years ago
When the degree of color contrast between items is low, the content is easier to see and read. True or False
Alexus [3.1K]

the answer is false

hope that helps

3 0
3 years ago
Adios brainly, wont be posting that much take my points away i d c
mrs_skeptik [129]
Omg I would die to have your points because when I get on people call me a noob because I just got the app like 3 days ago and every time I answer a question some says noob like dang I just started
5 0
3 years ago
Read 2 more answers
Most GUIs provide all of the following except _____.
erma4kov [3.2K]

Hello there! Your answer would be A.

GUIs are Graphical user interfaces. Command prompts are unique to Windows operators, so your best option would be A since the question covers most GUIs.

Hope this helps, have a great day!

7 0
3 years ago
Other questions:
  • To find temporary windows files begin by typing in the search box
    6·1 answer
  • When it comes to safety, the choice to be safe is often up to __________?
    8·1 answer
  • If you buy a 20 dollar thing with a 25 dollar gift card, do you still have 5 dollars?
    7·2 answers
  • A broker statement is an example of an ___ record
    12·2 answers
  • The computerization of the layout and paste-up process further complicated printing, as did the digitizing of photographs.
    12·1 answer
  • The benefit from dividing code into methods known as ________ is gained as follows: After you write code to perform a task once,
    14·1 answer
  • Impaired drivers are one of the many risks drivers face on the Highway Transportation System. List 3 signs that a driver could b
    10·2 answers
  • Write a program named split_me.py that accepts a string in the format Age.FirstName and returns the value FirstName is Age years
    14·1 answer
  • How do we prevent electrical problems as prescribe by the course?​
    11·1 answer
  • In the year, , the American Department of Defense put a military research network, called ARPANET online.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!