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 delimiter. 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.

Answers

Answer 1

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)


Related Questions

HELP I SUCK IN THIS HELP!!!!! ​

Answers

Answer:

I think it's print(5**3)

Which of the following is a table which can be rearranged to analyze data in a variety of ways?
A. Pivot Table
B. HLOOKUP Table
C. VLOOKUP Table
D. PivotLookup

Answers

Answer:

A. Pivot Table

Explanation:

Given that a Pivot Table is a form of a table in statistics that comprises various data of several tables in a shortened form.

This table is then used to carry out analysis of data in numerous ways to reach a meaningful conclusion to make a decision.

Hence, in this case, the correct answer is a PIVOT TABLE.

HELP PLEASE!!!!

3. Memory and Storage
The GCSE Computer Science course requires that you
understand how decimal numbers are converted into
binary, and vice versa.
Can you convert the numbers 12, 24, 48 and 96 into binary form?​

Answers

Answer:

1100 ; 11000 ; 110000 ; 1100000

Explanation:

Converting the following decimals to binary :

2__12

2__6 r 0

2__3 r 0

2__1 r 1

___0 r 1

12 = 1100 base 2

2.)

2__24

2__12 r 0

2__6 r 0

2__3 r 0

2__1 r 1

___0 r 1

24 = 11000 base 2

2__48

2__24 r 0

2__12 r 0

2__6 r 0

2__3 r 0

2__1 r 1

___0 r 1

48 = 110000 base 2

2__96

2__48 r 0

2__24 r 0

2__12 r 0

2__6 r 0

2__3 r 0

2__1 r 1

___0 r 1

96 = 1100000 base 2

What is the difference between internal hardware and software?


1. Internal hardware is the physical parts of a computer that you see on the outside; software is the physical parts of a computer that you see on the inside.

2. Internal hardware is the physical parts of a computer that you see inside the computer; software is the physical parts of a computer that you see on the outside.

3. Internal hardware is the programs and applications that make the computer work; software is the physical parts that help the computer work.

4. Internal hardware is physical parts that help the computer work; software is the programs and applications that make the computer work.

Answers

Answer:

4) Internal hardware is physical parts that help the computer work; software is the programs and applications that make the computer work.

pLZ PLZ PLZ HELP I HAVE SO MANY MISSING ASSINMENTS. why is physical security so important and necessary for both personal users and businesses?

Answers

Physical security is important because a physical attack is perhaps the most fundamental kind of attack. ... Using a floppy drive or CD-ROM drive on a machine that does not support good BIOS security. Damage to or theft of important machine components, especially those that store data. Theft of an entire machine

who is the father of animation?
Walt Disney
Steve Jobs
Winsor McCay
Matt Groening
and.. did Walt Disney invent the stop motion technique?

Answers

Answer:

Walt

Explanation:

Cause that n***a Frozen to

U get it lol xD

Answer:

Winsor McCay And no Walt Disney did not invent the stop motion technique

Explanation:

Range is an example of a ______________.



Python

Answers

The question isn't clear enough. I feel the question wants us to answer what category or type the range is in python.

Answer:

Range is a Function in python

Explanation:

Range is an example of a function in python. The range function takes its own argument when called. The range function can take up to 3 arguments but atleast 1 argument should be stated when it is called.

When range is called as ;

range(4) ;

This specifies the stop argument ; this evaluates as range of values from 0 up to 3 (4 is excluded) in the interval of 1

Output will be : 0, 1, 2, 3

range(4, 8) ;

This specifies the start and stop argument ; this evaluates as range of values from 4 up to 7 (8 is excluded) in the interval of 1

Output will be : 4, 5, 6, 7

range(4, 8, 2) ;

This specifies the start, stop and interval argument ; this evaluates as range of values from 4 up to 7 (8 is excluded) in the interval of 2

Output will be : 4, 6

which type of number represents bits of data that are transmitted from one device to another?
a) octal
b)decimal
c)hexadecimal
d)binary

Answers

The correct answer should be Binary

The formula for the trajectory of a ball is given by f(x)=xtanθ−12v20gx2cos2θ+y0 where x is a coordinate along the ground, g=9.81 is the acceleration due to gravity, v0 is the magnitude of the initial velocity which makes an angle θ with the x-axis, and (0,y0) is the initial position of the ball. Write a program to calculate the trajectory y=f(x) for 0≤x≤16, with y0=10, v0=10, θ=50∘. (Do Python trigonometric functions accept radians or degrees?) Let x vary between 0 and 16 with 101 points. You will need to:

Answers

Answer:

The program in python is as follows:

import math

def traj ect ory(th e ta,x,y,v):

   t = ma th . tan(m ath . radians(theta))

   c = math . cos(math . radians(theta))

   g = 9 . 8

   fx = x * t - (1/(2*v**2)) * ((g*x**2)/(c**2))+y

   return round(fx,3)

   

print("x\t f(x)")

for x in range(0,17):

   theta = 50

   y= 10

   v = 10

   print(str(x)+"\t"+str(tr aje ctory (the ta,x,y,v)))

Explanation:

The question is incomplete. However, I have written the program to calculate the trajectory values f(x).

See attachment for complete program where comments were used as explanation

James wants to buy a pair of pants for $60.
When he went to the store he found that the
price was marked down by 20%. How much do
they cost now?

Answers

They cost 48. Used a calculator

13.
_______allows you to organize and summarize selected columns and rows of data
in a spreadsheet to obtain a desired report:

A.Pivot chart
B.Rotate table
C.Pivot date
D.Pivot table

Answers

Answer:

D. Pivot table

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

Generally, it is extremely difficult and considered to be a herculean task to understand, analyze and summarize data when they are raw and unorganized.

In order to overcome this challenge or hurdle, Microsoft inc. designed and developed Pivot tables and charts to avail end users the ability to visualize, understand, analyze and summarize data in its raw form.

Hence, Pivot table allows you to organize and summarize selected columns and rows of data in a spreadsheet to obtain a desired report. It is an in-built feature of the Microsoft Excel software application or program.

the S. I unit
(2) write out
Current
C
Voltage
3. Resistance
2.

Answers

Answer:

1) Ampere (A)

2) Volt (A)

3) Ohm (Ω)

Which kind of image is indispensable and needs added text to go with it?

Answers

Answer:

A chart and a graph are kind of image that are indispensable and need added text to go with it.

How did imperialism lead to WWI? A The debate of the morality of imperialism created tensions around Europe b Native people were conquered and rebelled against Europe c Europe went into an economic depression when imperialism failed d European nations competed and made alliances to control colonies

Answers

Answer:

d. European nations competed and made alliances to control colonies.

Explanation:

The world War I was a period of battle between various countries from 1914 to 1918. It started formally on the 28th of July, 1914 and ended on the 11th of November, 1918.

Imperialism can be defined as a policy, ideology, or advocacy that sought to extend a country's power, dominion, authority and influence over another country through diplomacy, use of military force or colonization (direct territorial acquisition).

This ultimately implies that, imperialism is an advocacy or policy that is typically used to impose or extend a country's power, dominion, authority and influence. It simply means to seek colonies of other nations or countries.

Hence, imperialism led to WW1 because European nations competed and made alliances to control colonies.

In conclusion, there was an eagerness on the part of European Nations to gain colonial territories that were owned by other rival nations.

Generalized goals are more likely to be achieved than specific goals. True or False

Answers

False

They are likely to be achieved because they are well defined, clear, and unambiguous.

Timmy walks into a store to buy a PC game. He reads this information about a game on its packaging:

System Requirements
Minimum Recommended
Processor Intel Core i3 or equivalent Intel Core 2 Quad or higher
Memory 2 GB 4 GB or higher
Video Card Integrated Discrete


Based on this information, which statement is true?
A.
Timmy can play the game even if his computer’s specifications don’t meet the minimum requirements.
B.
Timmy can play the game even if his computer has less than 2 GB memory.
C.
Timmy can play the game at a higher level of visual detail if his computer has an integrated video card.
D.
Timmy can play the game even if his computer’s processor class is lower than an Intel Core i3.
E.
Timmy can play the game at a higher level of visual detail if his computer has an Intel Core 2 Quad processor.

Answers

Answer:

C. Timmy can play the game at a higher level of visual detail if his computer has an integrated video card.

Explanation:

The processor efficiency and memory requirements are much more necessary to get the game to run and give it a playable framerate. Having a video card will improve his graphics, so this is more of a suggestion than a necessity.

What woman ran for president on the National Equal Rights Party, receiving 4,149 votes in 6 states in 1884?

Answers

Answer:

The american attorney, politician, educator and author BELVA ANN LOCKWOOD

is a variable a number

Answers

A variable is a symbol standing for a unknown numerical value. Such as “x” and “y”

Answer:

No

Explanation:

A variable is like a symbol like a letter, that it used to describe a number.

what is the best resource to learn python?

Answers

Answer:

prolly a snake expert

Explanation:

they know snakes

snake i think but also a geco

What is extraction, transformation, and loading? Group of answer choices It is a process of entering data, tracking data, and loading it into a database. It is a process that is performed at the end of the data warehouse model prior to putting the information in a cube. It is a process that is performed at the beginning of the data mining model. t is a process that extracts information from internal and external databases, transforms it using a common set of enterprise definitions, and loads it into a data warehouse.

Answers

Answer:

It is a process that extracts information from internal and external databases, transforms it using a common set of enterprise definitions, and loads it into a data warehouse.

Explanation:

Extraction, transformation, and loading can be defined as a process that extracts information from internal and external databases, transforms it using a common set of enterprise definitions, and loads it into a data warehouse.

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

The act of color balancing in film is known as

A:Blue
B:white
C:Black
D:Gray

Answers

The answer is: color White.
B, Really just the most neutral color possible, which in most cases is white.

The property that allows a metal to be drawn into wires is called...
A. Hardness
B. Malleability
C. Ductility
D. Elasticity

Answers

Answer:

Malleability and ductility

Explanation:

Metals are also easily distinguished from non-metals and other materials in their ductility (ability to be drawn into a wire) and malleability (the ability to be beaten into a. sheet).

Did you need help on this with an assignment? Hope this helps!

Select the correct answer.

Nina obtains an image in which birds are flying across the sky. Some parts of the image are blurry. In which stage of image processing will Nina fix the blurry parts?

A.
image acquisition
B.
preprocessing
C.
extracting features
D.
segmentation

Answers

Answer: Image Acquisition

Explanation:

What is a font? A)
a typeface on a label
B) a typeface on a poster
C) a typeface on a computer or d) a typeface on a sign

Answers

Answer:

A is most likely the answer

Explanation:

output device is any peripheral to provide data and control signal to ab information processing system​

Answers

Answer:

Its false ita not "output" its "input"

Write a method that takes a parameter for the number of a month and prints the month's name. You may assume that the actual parameter value passed to the method is always between 1 and 12 inclusive.

This method must be called monthName() and it must have an integer parameter.

Calling monthName(8) should print August to the screen.

Answers

Answer:

Get month number from month name

Use Java's Calendar class. It can parse any given string into a valid calendar instance. Here is an example (assuming that the month is in english). Date date = new SimpleDateFormat("MMMM").parse(monthName); Calendar cal = Calendar.getInstance(); cal.setTime(date); println(cal.get(Calendar.MONTH)); You can specify the language in SimpleDateFormat: String monthName = "März"; // German for march Date date = new SimpleDateFormat("MMMM", Locale.GERMAN).parse(monthName); Calendar cal = Calendar.getInstance(); cal.setTime(date); println(cal.get(Calendar.MONTH)); By default, Java uses the user's local to parse the string. Keep in mind that a computer starts counting at 0. So, January will be 0. If you want a human readable date, you should format the calendar instance: SimpleDateFormat inputFormat = new SimpleDateFormat("MMMM"); Calendar cal = Calendar.getInstance(); cal.setTime(inputFormat.parse(monthName)); SimpleDateFormat outputFormat = new SimpleDateFormat("MM"); // 01-12 printlng

MARK ME BRAINIEST FOR MORE INFO

What is inputted into a computer system?

Answers

Answer:

Hey mate.....

Explanation:

This is ur answer.....

Input refers to any information, or data, that is sent to a computer for processing. Input is often sent to the computer from a device such as a keyboard, mouse, or other input device. Putting it simple, input is the act of entering data into a computer.

Hope it helps!

Mark me brainliest....

FOLLOW ME!!!! :)

The information regarding inputted into the computer system is as follows:

Input refers to any information, or data, that is sent to a computer for processing. Input is often sent to the computer from a device like a keyboard, mouse, or other input device. It is the act of entering data into a computer.

Learn more: brainly.com/question/17429689

Question 2 of 10
Priscilla wants to learn her grandmother's native language after seeing social
media highlighting her family's homeland. What type of impact is this?
A. Social and economic
B. Economic and personal
C. Personal and cultural
D. Ethical and personal

Answers


i thinkkkkkkkkkkkkkkkk D

Priscilla wants to learn her grandmother's native language after seeing social media highlighting her family's homeland.  Thos is ype of impact is this D. Ethical and personal.

What is the cultural impact?

Ethics are critical to people due to the fact they serve as (1) requirements of conduct for figuring out an accurate route of action, (2) pointers for decision-making and warfare resolution, and (3) impacts on worker motivation.

Changes that have an effect on people's surroundings (architecture, arts, customs, rituals etc.) because of influxes of travelers represent cultural impacts.

Read more about the  Ethical and personal:

https://brainly.com/question/1031443

#SPJ2

What's the vbsd canvas instructor address?

Answers

Answer:

Instructor access would be the same domain students use as they don't change for teachers on the canvas website.

Explanation:

CONCEPTO DE ORGANIGRAMA

Answers

como the amas si mucho gusto
Other Questions
Please help( I will give brainliest) Thanks How does freedom of the press help maintain a democratic society? 128= 4^2x times 2^x What is x? A note of frequency 200Hz has a velocity of 400m/s. What is the wave length of the note Ryan's tennis club membership, which is $11, is deducted automatically from his bank account every month. Which expression shows the total deductions for the year? ($11) 12 ($11) 12 ($11) 12 ($11) + 12 i need the answer and a explanation. simplify [tex]\frac{\sqrt{18} }{\sqrt{81} }[/tex] How does Raveloe compare with your idea of what a community should be? Y+3= -5(x-1) write the equation in slope intercept form What is better for a beginners pet leopard gecko or crested gecko This is for yassii Here's the end of your essay!!Elena woke up having a dream of being a famous celebrity now all she wants to do is to change her facials to a celebrity without having surgery.She searched up the nearest store, the location showed up a wizard store, she drove her car in a hurry, once she got there she saw a sign "no turning back," she didnt know what it meant but still walked in with joy, she then saw so many potions stacked up.She asks Casper the owner of the shop to get her a shapeshifting potion but didnt mention human potion so he thought she meant animal.She took a slight sip of it, as he tried to warn her that the animal spell lastsforever unless a wizard changes her back. it was too late because she already took her first sip, she transforms into a snake.What did you do, hissed Elena, whats happening to me?? I warned you didnt I?" said Casper. Elena hissed her way out of the shop to Bonnie's house, then she went on the search for a wizard to change her back. She thought to herself, "Maybe the wizard can actually change my face so I can be an actor too!"After days and days of searching, she found the wizard tower. She made her way to the tower and then she hissed and he tried to understand but he couldn't. So, he decided to get a snake translator. He worked on her for days and finally got her to look like a human again. She asked for him to change her features too. Later that month she starred in a movie called, "The girl who turned into a snake." In the end, there was an interview and she thanked that wizard that helped her make her dreams come true.I hope you like this!!!! BRAINLIEST What can magnetic attraction and filtration both be used to do?Put components together to make a mixture.Put components together to make a compound.Separate compounds into their components.Separate mixtures into their components. A bookshelf is 45 inches wide. How many 1 & 1/2 inch wide books will fit on the bookshelf? * Down syndrome in humans may result from. A a person inheriting a recessive allele. B sickle-shaped cells becoming stuck in blood vessels.c an extra copy of chromosome 21. D blood failing to clot properly. How many years do you have to go to school to get your med degree?how long does it take to be come a doctor? Robyn sells 100 tickets to the fourth grade play. The table shows the part of the tickets she sold of each type. What fraction of the tickets were adult and student tickets ? simplify 4*3 4*2 4*5 Find the value of Z for the triangles Put these fractions in order of size, smallest first In a DNA molecule, G pairs with __ The difference between a number and 3 is no more than 2