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
Jlenok [28]
3 years ago
8

"What does the list look like after this code executes?

Computers and Technology
1 answer:
Marat540 [252]3 years ago
7 0

Answer:

The list created by the split method in Python 3 will be ["red", "orange", ""yellow", "green", "blue"]

Explanation:

In Python 3, the split method takes the input string, in this case is colors = "red,orange,yellow,green,blue", and split it into a list and you can indicate the separator that the method will use.

The general syntax for this method is:

string.split(separator,max)

separator indicates the character that will be used as a delimiter of each list member and the max parameter indicates the maximum number of separations to make.  

Since each color in your string is separated by the character "," the code will make a list in which every color is a separated string.

You might be interested in
When an IPv6 device with no pre-configured IPv6 address powers up, it can calculate a global 128-bit IPv6 address for itself usi
RSB [31]

Answer:

True

Explanation:

IPv6 Is a later version of IP addresses, used to solve the problem of the limited number of IPv4 addresses in the network.

Just like IPv4, IPv6 can also is configured to a device statically and dynamically. Dynamic IPv6 configuration could be a stateless autoconfiguration SLAAC, a stateless DHCPV6 or a stateful DHCPV6.

The IPv6 address is configured with a prefix and a prefix length and a EUI generated 64 bit interface or a random interface id by the device.

8 0
3 years ago
Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A’s frames w
Mariana [72]

Answer:

Following are the solution to the given question:

Explanation:

Please find the complete and correct question in the attachment file.  

For Point a:

For the second round,

A is selects kA(2)  either 0 or 1, so for each of them, that is \frac{1}{2}.

B selects kB(2)\  from\  (0, 1, 2, 3) for each choice with the probability of \frac{1}{4}.

If kA(2) < kB(2) wins the second rear race.

\to P[A \ wins] = P[kA(2) < kB(2)]

                     = P[kA(2) = 0] \times P[kB(2) > 0] + P[kA(2) = 1] \times P[kB(2) > 1]\\\\= \frac{1}{2} \times \frac{3}{4}  + \frac{1}{2}  \times \frac{2}{4} \\\\=\frac{3}{8}  +\frac{2}{8} \\\\= \frac{3+2}{8}\\\\= \frac{5}{8}

For Point b:

Throughout this example, kA(3) also selects to be either 0 or 1 with such a \frac{1}{2} probability. So, although B chooses kB(3) from (0, 1, 2, 3, 4, 5, 6, 7), the probabilities each are \frac{1}{8}:

\to P[A \  wins] = P[kA(3) < kB(3)]

                     = P[kA(3) = 0] \times P[kB(3) > 0] + P[kA(3) = 1] \times P[kB(3) > 1]\\\\= \frac{1}{2} \times \frac{7}{8} + \frac{1}{2} \times \frac{6}{8}\\\\= \frac{7}{16} + \frac{6}{16}\\\\= \frac{7+6}{16} \\\\= \frac{13}{16}\\\\

For point c:

Assume that B tries again 16 times (typical value), and it destroys. In addition, throughout the exponential background n is obtained at 10 when choosing k between 0 to 2n−1. The probability of A winning all 13 backoff events is: P[A \text{wins remaining races}] = 16\pi i =4P[A \ wins \ i |A \ wins \ i -1 ]

Let the k value kA(i) be A for the backoff race I select. Because A retains the breed

=(kA(i)] \cdot P[kA(i+ 1)< kB(i+ 1)] \geq P[kA(i) + 1

For point d:

Two stations A and B are supposed. They assume that B will try 16 times afterward. Even so, for A, 16 races were likely to also be won at a rate of 0.82 For Just higher expectations of three A, B, and C stations. For Station A, possibility to win all backoffs

3 0
3 years ago
The two roots of a quadratic equation, for example 2 + + = 0, can be obtained using the following formula: Two Roots: 1 = − + √
Vladimir79 [104]

lst = input("Enter a,b,c: ").split(",")

a = float(lst[0])

b = float(lst[1])

c = float(lst[2])

root1 = (-b + ((b**2-(4*a*c))**0.5))/(2*a)

root2 = (-b - ((b**2-(4*a*c))**0.5))/(2*a)

dis = b**2 - (4*a*c)

if dis > 0:

   print("The roots are {} and {}".format(root1, root2))

elif dis < 0:

   print("The equation has no real roots")

else:

   print("The root is {}".format(root1))

I wrote my code in python 3.8. I hope this helps!

5 0
3 years ago
I need help writing a recursion function to solve a boggle game for c++.
Mandarinka [93]

Answer:

#include <cstring>

#include <iostream>

using namespace std;

 

#define A 3

#define B 3

 

// LET US CREATE A DICTIONARY

string dict[] = { "KILLS", "GOT", "QUIZ", "GO" };

int n = sizeof(dict) / sizeof(dict[0]);

 

// Let us make a function to find whether a given word is present in dictionary.

bool isPresent(string& str)

{

   // linear search of words

   for (int i = 0; i < n; i++)

       if (str.compare(dict[i]) == 0)

           return true;

   return false;

}

 

// A function for printing all words present on Boggle

void findWordin(char bogle[A][B], bool hasbeenvisited[A][B], int i,

                  int j, string& str)

{

   hasbeenvisited[i][j] = true;

   str = str + bogle[i][j];

 

   // If str is in the dictionary, then you need to print it

   if (isPresent(str))

       cout << str << endl;

 

   // Travering adjacent 8 cells of the boggle

   for (int r = i - 1; r <= i + 1 && r < A; r++)

       for (int c= j - 1; c <= j + 1 && c < B; c++)

           if (r >= 0 && c >= 0 && !hasbeenvisited[r][c])

               findWordin(bogle, hasbeenvisited, r, c, str);

 

   // for erasing current characters on the string, and mark them visited

   // of the current cells to false  

   str.erase(str.length() - 1);

   hasbeenvisited[i][j] = false;

}

 

// Prints all words which are in dictionary.

void findWords(char boggle[A][B])

{

   // for marking all the characters as not being visited

   bool hasbeenvisited[A][B] = { { false } };

 

   // Initializing the present string

   string str = "";

 

   // Reading all the characters for finding all the words that begins with the above character

   for (int i = 0; i < A; i++)

       for (int j = 0; j < B; j++)

           findWordin(boggle, hasbeenvisited, i, j, str);

}

 

// the code for testing of the function

int main()

{

   char bogle[A][B] = { { 'k', 'I', 'L' },

                         { 'L', 'S', 'M' },

                         { 'G', 'O', 'T' } };

 

   cout << "Below list of words are present in the dictionary\n";

   findWords(bogle);

   return 0;

}

Explanation:

The program is properly commented, and that explains each step of it.  However, I have kept dictionary as constant for similifying the code. And it can be set to variable easily, if required.

7 0
3 years ago
I forgot hahahahahahahahahahahaha
Nadusha1986 [10]

Answer:

Condensation

Explanation:

Condensation is the conversion of a vapor or gas to a liquid.

4 0
3 years ago
Other questions:
  • What's the minimum number of ip addresses that a router must have?
    6·1 answer
  • . Write a recursive function names factorial to compute the factorial of the parameter. Also write the main function, where you
    15·1 answer
  • Object Oriented Programming (OOP) allows us to handle complex code in an organized structure and break down the problem by model
    5·1 answer
  • Create two algorithms for an everyday problem such as computing sales tax or figuring out the number of tables to seat guests. T
    10·1 answer
  • Outline the things that Mccann needs to do right away
    13·1 answer
  • Use the drop-down menus to complete the statements about printing Contacts. When printing a single contact, go to File and then
    15·1 answer
  • Of the following potential benefits, which is LEAST likely to be provided by the upgraded system?
    12·1 answer
  • What would your leadership style be?
    14·1 answer
  • 2. Cryptography relies on open standards - a protocol or standard that is publicly available. Why are open standards necessary
    5·1 answer
  • To call the superclass's no-parameter constructor explicitly, use super(); group of answer choices true false
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!