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
Write a program in C which will open a text file named Story.txt. You can create the file using any text editor like notepad etc
ddd [48]

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <stdlib.h>

int main()

{

FILE * file_object;

char file_name[100];

char ch;

int characters=0, words=0;

printf("Enter source file name: ");

scanf("%s", file_name); //asking user to enter the file name

file_object = fopen(file_name, "r"); //open file in read mode

if (file_object == NULL)

{

printf("\nUnable to open file.file not exist\n"); //check if the file is present or not

}

while ((ch = fgetc(file_object)) != EOF) //read each character till the end of the file

{

if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\0') //if character is space or tab or new line or null character increment word count

words++;

else

characters++; //else increment character count this assures that there is no spaces count

}

printf("The file story.txt has the following Statistics:\n"); //finally print the final statistics

if (characters > 0)

{

printf("Words: %d\n", words+1); //for last word purpose just increment the count of words

printf("Characters (no spaces): %d\n", characters);

}

fclose(file_object); //close the file object

return 0;

}

6 0
3 years ago
write a c++ program that takes a string input from the user and removes all characters except numerals also display the number o
Xelga [282]

Answer:

hi

Explanation:

5 0
3 years ago
Determine the exact output of the code:
stiv31 [10]

Answer:

3

Explanation:

The function floor() is used to give the integer which is smaller than or equal to the provided decimal value.

for example:

let a=5.8

floor(a);

the function provides the value 5 (smaller than or equal to 5.8).

In the given code:

variable num assigns the number 3.14.

then, floor(3.14) gives the value 3 (smaller than or equal to 3.14).

then, the echo print the value on the screen.

Therefore, the correct answer is 3.

4 0
3 years ago
Corinne would like to click on the link at the bottom of a Web page but she only sees the top portion of the page. She should __
IgorLugansk [536]
Corinne should scroll down to the bottom of the page to where she can see the link
7 0
3 years ago
Read 2 more answers
HAve a good week lads, good luck on work :D
Leno4ka [110]

Answer:

v; its alright.

Explanation: none v;

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following Office Online apps is most effective for creating multi-media presentations
    15·1 answer
  • Why is a memory hierarchy of different memory types used instead of only one kind of memory?
    13·1 answer
  • People using commercially available software are usually asked to read and agree to a(n) _____
    10·1 answer
  • When can you access the BIOS setup utility?
    14·1 answer
  • What happens to a message when it is deleted?
    11·1 answer
  • Write the correct statements for the above logic and syntax errors in program below.
    12·1 answer
  • In French class, Blue puts on a visor and the environment changes to that of a café in Paris. Which of the following terms descr
    12·2 answers
  • Create a SELECT statement that returns the count, average, max and min of the invoices submitted by each vendor, who has submitt
    8·1 answer
  • How to write my name in binary code ? Rivas
    7·2 answers
  • In this assignment you will be building an implementation of the hypothetical machine simulator like the one discussed in chapte
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!