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
morpeh [17]
3 years ago
13

Question 3 (8 marks): Write a program that takes a string from the user and splits it into a list using a space (" ") as the del

imiter. Do not use split(). Print the result. Hints: Use a for loop to loop through the string. Keep track of the index of the last part of the string that you "split". When you reach a space, you know to split again. Use string slicing to get the portion of the string that you want.
Computers and Technology
1 answer:
bonufazy [111]3 years ago
5 0

Answer:

In Python:

mystr = input("Sentence: ")

mylist = []

word = ""

for i in range(len(mystr)):

   if not i == len(mystr)-1:

       if not mystr[i] == " ":

           word+=mystr[i]

       else:

           mylist.append(word)

           word = ""

   else:

       word+=mystr[i]

       mylist.append(word)

print(mylist)

Explanation:

Prompt the user for an input sentence

mystr = input("Sentence: ")

Initialize an empty list

mylist = []

Initialize each word to an empty string

word = ""

Iterates through the input sentence

for i in range(len(mystr)):

If index is not the last, the following if condition is executed

   if not i == len(mystr)-1:

If the current character is not space

       if not mystr[i] == " ":

Append the character to word

           word+=mystr[i]

If otherwise

       else:

Append word to the list

           mylist.append(word)

Set word to an empty string

           word = ""

If otherwise; i.e. If index is not the last

   else:

Append the last character to word

       word+=mystr[i]

Append word to the list

       mylist.append(word)

Print the list

print(mylist)

You might be interested in
State 10 differences between video conferencing and teleconferencing​
mr_godi [17]
Answer:
Teleconferencing is voice-only or audio and video communication, while video conferencing supports the conference by providing both video and voice, so you can fully see the person when you are listening to the communicator,

Teleconferencing is capable of transmitting the data during the conference, either using traditional PBX systems or VoIP, while video conferencing offers VoIP services. The formal requires less bandwidth, while the latter is highly dependent on network bandwidth.


6 0
3 years ago
You open a folder Properties box to encrypt the folder, click Advanced, and discover that Encrypt contents to secure data is dim
yaroslaw [1]

Most likely a virus has attacked the system and is disabling encryption is the most likely problem.

c. Most likely a virus has attacked the system and is disabling encryption.

<u>Explanation:</u>

The end users can protect the folder by enabling encrypt the folder or files. But in windows encrypting the file or folder is not available. The computer management console is used to open all other services such as risk management, performance management extra.

In some other operating encryption of folder or files is allowed.  Third-party software is available to protect folder or files once the third party used any files possible to share outside the world.

As far as my knowledge there is encrypting technology is available in the windows operating system.

5 0
3 years ago
A <br> is usually written in block style with the body text aligned along the left margin.
Fiesta28 [93]

Answer:

can you give the question and the rest of the answers? (if possible)

Explanation:

i dont really get it, are you answering a question or something?

7 0
3 years ago
Read 2 more answers
What pressure will be shown on the high side peessure gauge (ac system on)
maria [59]
H tht would be the correct answer
8 0
4 years ago
A (blank) is a special row in an Excel table that provides a selection of
Colt1911 [192]

A Data series is a special row in an Excel table that provides a selection of  aggregate functions useful for working with numerical data.

Data series

<u>Explanation:</u>

As MS-excel worksheet is used to huge or series of calculation. Through MS-excel people use for calculation and do series of analysis and do graph output.

Even in software development reports are generated and export to MS-excel and further analysis, calculation are made.

MS-excel is wonderful tools is used in computer technology. in MS-excel has many inbuilt function where can be used with single cell or range of cells.

In MS-excel aggregate function such as sum, count, max or min is inbuilt function readily available to user it.

3 0
3 years ago
Other questions:
  • kindly for the website of stedeo code.org if I login is the time of logging appears at my teacher ??is it registered ​
    14·1 answer
  • Which of these protects against the most common attacks on the internet via a database of signatures, but at the same time actua
    9·1 answer
  • Luchen Modo, a software development firm in Asia, launched a new software for smartphones that allowed users to remotely control
    11·1 answer
  • Which of the following “invisible” marks represents an inserted tab?
    11·2 answers
  • hãy lựa chọn một doanh nghiệp kinh doanh theo loại hình siêu thị việt nam em hãy tìm hiểu doanh nghiệp và thực hiện theo yêu cầu
    10·1 answer
  • What is the purpose of the Hide Slide feature in a presentation program?
    14·1 answer
  • Which IP QoS mechanism involves prioritizing traffic? Group of answer choices IntServ RSVP COPS DiffServ None of the above
    14·1 answer
  • Output is the act of is the act of entering the data to the computer?​
    10·1 answer
  • How to transfer crypto from coinbase to coinbase wallet
    14·1 answer
  • In python please.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!