The code below assigns the 5th letter of each word in food to the new list fifth. However, the code currently produces errors. Insert a try/except clause that will allow the code to run and produce of list of the 5th letter in each word. If the word is not long enough, it should not print anything out. Note: The pass statement is a null operation; nothing will happen when it executes.
food = ["chocolate", "chicken", "corn
fifth = []
for x in food:
fifth.append(x[4])

Answers

Answer 1

Answer:

Answered below

Explanation:

foods = ["chocolate", "chicken", "corn"]

fifth_char = []

for food in foods:

"""Add a try statement to add fifth character to fifth_char list. If word is not long enough, the except part executes the the pass and nothing is printed.""'

try:

fifth_char.append(food[4])

except:

pass

#print out elements in new list

for c in fifth_char:

print(c)


Related Questions

Which of the following describes the line spacing feature? Select all that apply. adds space between words adds space between lines of text adds space between paragraphs adds space at the top and bottom of a page adds bullet points or numerical lists

Answers

Answer:

adds space between lines of text

adds space between paragraphs

Explanation:

From the philosophical standpoint, especially in the discussion of moral philosophy or ethics, why do we consider “murder” or “killing” wrong or bad?

Answers

Explanation:

Morality is a set of values ​​and habits that a society acquires over time and can be categorized as good and bad values, right and wrong, justice and crime. Ethics is defined as the study of morals, the practical application of moral behaviors defined by society.

Therefore, the concept of "murder" or "killing" is seen as an immoral act by the vast majority of society around the world, strengthened by the set of moral conduct common to all human beings, which are the Articles on the Universal Declaration of Human Rights. Human Rights, which is an official document of the UN, which contains several universair and analytical rules on the rights of every individual, such as the right to life, security, freedom, etc.

what of the following uses heat from deep inside the earth that generates steam to make electricity​

Answers

Answer:

Geothermal power plants.

I have this project and I can't do anything about it, I do really need help ASAP

Answers

sorry i can't i am confused

(Hours, minutes, and seconds) Write a method that returns a string in the form of hour:minute:second for a given total seconds using the following header:
public static String format(long seconds)
Here is a sample run:

Enter total seconds: 342324
The hours, minutes, and seconds for total seconds 342324 is 23:05:24

Note that a zero is padded to hour, minute, and second if any of these values is a single digit.

Answers

Answer:

Answered below.

Explanation:

class Convert {

public static String format(long seconds) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter total seconds: ");

int secs = sc.nextInt();

int hours = secs / 3600;

int minutes = (secs % 3600) / 60;

int seconds = (secs % 3600) % 60;

String timeFormat = hours + ":" + minutes + ":" + seconds;

return timeFormat;

}

}

Explain the paging concept and main disadvantages of pipelined
approaches? Compare the superscalar and super pipelined approaches
with block diagram?

Answers

Answer:

PAGINACIÓN En la gestión de memoria con intercambio, cuando ... Debido a que es posible separar los módulos, se hace más fácil la modificación de los mismos. ... Ventajas y Desventajas de la segmentación paginada

Explanation:

How was the first computer reprogrammed

Answers

Answer:

the first programs were meticulously written in raw machine code, and everything was built up from there. The idea is called bootstrapping. ... Eventually, someone wrote the first simple assembler in machine code.

Explanation:

Many individuals and organizations are choosing cloud storage for their important files. Discuss the pros and cons of cloud storage for both personal files and business files. Many individuals and organizations are choosing cloud storage for their important files. Discuss the pros and cons of cloud storage for both personal files and business files. What inputs and outputs are needed to support the storage environment

Answers

Answer:

Pros of cloud storage

Files can be accessed remotely without having to be connected to a company's intranetSecurity and file backups are managed by the cloud storage company, frees up employees time applying updates and other maintenance tasks.Usually billed monthly which allows for a lower initial startup cost

Cons of cloud storage

File security relies upon trust in the cloud storage providerLong term cost could be higher than storing files yourselfRequires an internet connection to access files
Other Questions
white sands national monument in New mexico has hundreds of miles of white sand dunes made of gypsum crystals. which of the following would you expect to be true of white sands national monument?a. it receives no radiationb. it is immune to insolationc. it has a high albedod. it has no heat capacity Pls help, I mark u brainlist if is right!!On an interdisciplinary team, the decision making___a. is done by the core medical personnelb.occurs only when the patient is dischargedc. takes into account the views and information gathered from all involvedd. is the responsibility of the doctor in charge Find the measurements of DBC what is the maximum number of interior reflex angles that a hexagon can have? SOMEBODY PLEASE HELP SHE SAID TO WRITE THE SOLFEGE AND COUNTS FOR BOTH PARTS The county with the largest geographic area exports _____. 1.the most oil 2.the least amount of oil3. The third amount of oil 4. No oil at all I'm in exam please answer this question Which expression is equivalent to ( + )? Who was Baron von Steuben, and how did he help the Americans? 5. Predict long-term changes to the surface landscape of the area if too much water is drawn from the ground and the water table drops further. 71 is 10% of what number?52 is 97% of what Number? Explain steps. What is the largest State in the world? Here are the ingredients needed to make 16 biscuits.BiscuitsIngredients to make 16 biscuits175 g of butter75 g of sugar250 g of flourAnna has500 g of butter300 g of sugar625 g of flourWork out the greatest number of biscuits Anna can make. Which of the following industries most matches Alfred Webers model of industrialization?A.a lumber business in the Pacific NorthwestB.a coffee roaster in GermanyC.a fish-stick factory in KansasD.an oil refinery in New EnglandE.a slaughterhouse in the center of the city All of the following characterize both perfectly competitive and monopolistically competitive markets EXCEPT: Price is equal to average revenue. Price is equal to average revenue. A Individual firms produce output where marginal cost equals marginal revenue. Individual firms produce output where marginal cost equals marginal revenue. B Firms can affect the selling price of their product. Firms can affect the selling price of their product. C The market has a large number of firms. The market has a large number of firms. D Firms can easily enter or exit the market. Why did people suffer under Joseph's Stalin's rule? Figurative Language (need help) The business college computing center wants to determine the proportion of business students who have laptop computers. If the proportion differs from 25%, then the lab will modify a proposed enlargement of its facilities. Suppose a hypothesis test is conducted and the test statistic is 2.4. Find the p-value for a two-tailed test of hypothesis. How did the discovery of oil change the U.S. and the world?10-12 sentences is it possible to have the ordered number pair 3;7 on the graph