Free Essay


In: Science

Submitted By carreonjaninem
Words 257
Pages 2
Part 3

To understand iteration

To create loops in Python

To create programs with conditional and iteration statements

Iterative statements

The loop mechanism causes repeated execution of a sequence of statements as long as a certain condition is true.

Types of loops:

While loop




Write a program that prints the integer cube root of an integer. If the input is not a perfect cube, it prints a message to that effect.

*Guttag, JV. Introduction to Computation Using Python

We used “guess and check” or exhaustive enumeration as our algorithmic technique.

For loop

can be defined by range, strings*, or lists*.

*We’ll use these for for loops when we get to these topics.




Write a program that prints the sum of N integers.

What would be the output of the following code? Describe the program.

if-else + loops

Given an integer n, create a program that does a count down (to zero) if the integer is positive and does a count up (to zero) if the integer is negative.

Behavior changing keywords

exits out of the smallest enclosing loop.

terminates the loop and transfers execution to the statement after the loop

forces a loop to loop again, skipping the rest of body

Create a program that produces a random number and makes the user guess that number. Clues are given (higher or lower) to help the user guess the number.

Loop statements may have an clause which is executed when a loop is not terminated by a break.

Similar Documents

Premium Essay


...PART A 1. Nuclear fission produces energy when energy is released from the breaking or splitting apart a large nucleus in smaller ones (breaks apart the nucleus). The total mass of the reactants is slightly more than the total mass of the products. 2. Nuclear reactors produce electricity from by using the heat from radioactive materials (fission reaction) to convert water into steam into a container that has fuel and the water. The water is then pumped through another container which has water to avoid the radioactive water coming in contact with the turbine. The heat from the primary water is used by the secondary water and water is then again, converted into steam. The secondary water is used to run the turbine generator to produce the electricity. The different components of a nuclear power plant are containment structure which houses the control rods, fuel rods, primary coolant, steam generator, pump and reactor vessel. When the steam flows out to the containment structure is passes through turbines, the condenser, condensate, secondary coolant and pump. From the condenser, warm water is pushed through to the cooling tower, then back to the body of water (water source). From the body of water, cooling water is passed through to the pump to carry it to the containment structure. From the turbine, steam is passed through generator, to release electricity for use. 3. The similarities between nuclear power plants and nuclear bombs are that they are......

Words: 567 - Pages: 3

Premium Essay


...Participation Participate in class discussion 3 of 7 days with at least 2 substantive posts on each of the three days. 2 Discussion Questions Respond to weekly discussion questions. DQ1:Wed DQ2:Sat 2 Nongraded Activities and Preparation Complete the Equation Editor tutorial and Virtual ChemLab Tutorial located on your student website. Individual Text Exercises, Part I Resources: Equation Editor tutorial Prepare written answers to the following assignments from Introductory Chemistry: • Exercise 20 in Ch. 1 • Exercise 120 in Ch. 2 • Exercise 112 in Ch. 3 • Exercise 120 in Ch. 4 • Exercise 100 in Ch. 5 • Exercise 126 in Ch. 6 • Exercise 116 in Ch. 7 • Exercise 100 in Ch. 8 Submit the assignment, as directed by your facilitator. Friday 5 Individual Virtual ChemLab Assignment 2-4 Access and view the Virtual ChemLab Tutorial, located on the student website. Complete 2-4: Precipitation Reactions from Virtual ChemLab: General Chemistry Laboratories, located on the student website. Note. To complete the assignment, the Virtual ChemLab software must be installed on your computer and must be used in conjunction with Virtual ChemLab: General Chemistry Laboratories. Installation requirements and instructions may be found in the workbook and on the accompanying CD. Once the software is installed, an electronic workbook may be found corresponding with your workbook, which contains preset lab assignments that match the workbook assignments. Use these......

Words: 1174 - Pages: 5

Free Essay

Analytical Chem

...Patroescu, C.; Chalmers, R. A. Education and Teaching in Analytical Chemistry. Ellis Horwood: Chichester, 1982. Hieftje, G. M. “The Two Sides of Analytical Chemistry,” Anal. Chem. 1985, 57, 256A–267A. Kissinger, P. T. “Analytical Chemistry—What is It? Who Needs It? Why Teach It?” Trends Anal. Chem. 1992, 11, 54–57. Experiments The following exercises and experiments help connect the material in this chapter to the analytical laboratory. Calibration—Volumetric glassware (burets, pipets, and volumetric flasks) can be calibrated in the manner described in Example 5.1. Most instruments have a calibration sample that can be prepared to verify the instrument’s accuracy and precision. For example, as described in this chapter, a solution of 60.06 ppm K2Cr2O7 in 0.0050 M H2SO4 should give an absorbance of 0.640 ± 0.010 at a wavelength of 350.0 nm when using 0.0050 M H2SO4 as a reagent blank. These exercises also provide practice with using volumetric glassware, weighing samples, and preparing solutions. Suggested readings give the student access to more comprehensive discussion of the topics introduced within the chapter. References The references cited in the chapter are provided so the student can access them for further information. Laitinen, H. A. “Analytical Chemistry in a Changing World,” Anal. Chem. 1980, 52, 605A–609A. Laitinen, H. A. “History of Analytical Chemistry in the U.S.A.,” Talanta 1989, 36, 1–9. Laitinen, H. A.; Ewing, G. (eds). A History of......

Words: 88362 - Pages: 354

Free Essay

Organic Chem

...CHEM 232 1. Organic Chemistry II Problem Set 12 Identify each of the following compounds as reducing or nonreducing sugars: H HO HO H HO CH2 O H OH H CH2OH OH B Nonreducing sugar (acetal) CHO H H E OH OH CH2OH CHO OH OH OH CH2OH H H G OH HO CH2OH O H H H OCH2CH3 H HO H OH OH CH2OH O H H H OH CH2 O C OH H CH2OH H OH H H O H HO A Reducing sugar (hemiketal) Nonreducing sugar (acetal and ketal) CH2OH C O OH OH CH2OH CH2OH HO OH H O H CH2OH H H H H F OH D Reducing sugar (hemiketal) Reducing sugar (aldose) Reducing sugar (aldose) Reducing sugar (ketose) 2. Which of the structures shown above are: a. Pyranose monosaccharides A and B b. Furanose monosaccharides D c. Tetroses E d. Aldopentoses F e. Ketopentoses G f. Disaccharides C 3. Give the Haworth formula for α-D-Glucopyranose. H HO H OH CH2OH O H H OH H OH 4. Complete the following reactions: a. CH3CH2CH(OH)CH2OH b. O HOCH2 C CH2OH HIO4 CH3CH2CHO + CH2=O OH O O AgNO3-NaOH NH3 HOCH2 CH C Ag0 OH HOCH2 C c. H H CHO OH OH CH2OH HIO4 3 HCO2H OH CHOH HOCH2 CH C d. O H CHO H H OH OH CH2OH HCN CN H H H OH OH OH CH2OH HO CN H OH OH CH2OH + CH2=O + H H e. H HO H CHO OH H OH CH2OH NaBH4 H2O H HO H CH2OH OH H OH CH2OH h. H HO f. HO H H CHO H OH OH CH2OH CHO 1. Br2/H2O 2. H2O2 Fe2(SO4)3 H H OH OH CH2OH g. CHO H OH H H OH OH CH2OH 3 PhNHNH2 CH NNHPh C H H NNHPh OH CH2OH O H H H OH OH H OH CH3OH H+ ...

Words: 401 - Pages: 2

Premium Essay


...Georgia Institute of Technology CHEM 3700 Research Paper The German Energiewende “Die deutsche Energiewende“ Professor: Dr. Thomas Orlando Student: Shyam Rangarajan Abstract With the diminishing reserves of fossil fuels compounded by their negative effects on the environment, clean and renewable sources of energy to meet next generation energy demands undoubtedly need to be found. However an even more critical aspect governing global energy challenges is the way governments around the world take responsible actions and implement energy policies that are conducive to a sustainable future. A recent development in this regard is the German Energiewende, or Energy Transformation, one of the most ambitious projects of its type. The project aims to completely transition the German energy sector to one powered by renewables by the year 2050. Along with the benefits to energy security and controlled carbon emissions that such a policy would bring, the German government‟s efforts have also sparked a wide-scale increase in investment into emerging technologies. This has led to a vast increase in employment in the energy sector, and has also given rise to the concept of „prosumers‟, or individuals who produce and sell their own electricity through privately owned solar installations. Although the long term benefits of this project are enormous and the potential limitless, there are several short term repercussions that are slowing it down. Chief among these is the spiraling...

Words: 3572 - Pages: 15

Premium Essay

Titration Experiment 4, Chem 201

...CHEM. 201, EXPERIMENT 4 TITRATION CURVES PROCEDURE: See the pre-lab report on page 15 of my laboratory notebook for an outline of the general procedure. The unknown acid number was 6553, and the concentration of NaOH used in the experiment was .09912 M. Also, three drops of phenolphthalein indicator were added to the initial titration and the titration curve. EXPERIMENTAL DATA: Initial Titration: * Volume of NaOH added at the endpoint was 29.8 mL Titration Curve: * Volume of NaOH added at the endpoint was 29.0 mL CALCULATED RESULTS: Acid concentration from first titration was .118M Ka from initial pH was 1.08x10^-5 Acid concentration from titration curve was .115M Titration | Volume of NaOH (mL) | pH | (base)/(acid) | pKa | Ka | 1/4 | 7.25 | 4.1 | 1/3 | 4.577 | 2.65x10^-5 | 1/2 | 14.5 | 4.6 | 1 | 4.6 | 2.55x10^-5 | 3/4 | 21.8 | 5.19 | 3 | 4.713 | 1.94x10^-5 | Average: | | | | 4.663 | 2.18x10^-15 | DISCUSSION: The purpose of the experiment was to titrate a weak acid of unknown concentration with a strong base, NaOH, and then utilizing an initial titration and titration curve to determine that acid concentration and Ka. After performing the initial titration of the acid concentration, we calculated it to be 0.118 M, with a Ka of 1.08x10^-5. On the other hand, when we performed the titration curve, it calculated an acid concentration of 0.115 M and a Ka of 2.18x10^-5. The results I obtained seemed......

Words: 545 - Pages: 3

Premium Essay


...some Limewater, which caused it to bubble and turn cloudy * Next, I let the gas from the sodium and hydrogen peroxide go into some Bromthymol Blue. It turned yellow. * When I mixed the Alka Seltz/water solution excess gas into the limewater it... [continues] Read full essay Cite This Essay APA (2013, 06). Experiment 4: properties of gases. Retrieved 06, 2013, from MLA MLA 7 CHICAGO Welcome is the web's leading learning tool. We inspire millions of students every day with over 1,600,000 model essays and papers, AP notes and book notes. Related Essays Properties of gases - chem labpaq ...Properties of Gases General Chemistry 1 Lab 5 Abstract: The purpose of this experiment is... 3 Pages March 2013 Chemistry lab 3 properties of gases ...Dex Cimino 3/24/2013 CHE101, Tamburro Lab 3 – Properties of Gases Data Table: Experiment... 2 Pages March 2013 Properties of gases ...Gas | Flame Reaction | Glowing Splint | Limewater Reaction | Bromothymol Blue Reaction |... 3 Pages July 2013 Properties of gases ...Purpose: The purpose of this experiment was to test and observe the physical and chemical... 7 Pages July 2013 Properties of gases lab ...Student Mrs. Teacher Class Date Katie Limbach Mrs. Falk Chemistry 09-13-13 Title:... 4......

Words: 609 - Pages: 3

Premium Essay


...University of Phoenix Material Week 4 Exercises Prepare written answers to the following exercises: 1. Imagine that you are an environmental scientist. Working in collaboration with a university chemist, you were able to determine from mass spectrometry that four elements exist in your soil samples. They are Se, Sn, Pb, and Cd. You need to determine which elements will most likely combine with oxygen to produce oxides that are present in your sample. To do so, refer to the periodic table to determine the electron configuration and ionization energy of each element. This will show the number of valence electrons for each element. • What are the electron configurations for Se, Sn, Pb, and Cd? • What are the valence electrons for Se, Sn, Pb, and Cd? • Rank the elements in increasing ionization energy. • Which element will form oxides? 2. Imagine that, as an employee of a pharmaceutical company, you are working on an H-K-ATPase. It is the enzyme that pumps acid into the stomach to help in digestion. You are trying to determine whether a compound will fit inside the pocket of this enzyme in order to inhibit the enzyme. To do so, you must know the molecular shape of the compound. Draw the Lewis structure and determine the molecular geometry of the following compounds that may fit into the active site of this enzyme: 0. CO2 0. KOH 0. NO3 0. HCN 3. Imagine that you work as a chemist in a battery......

Words: 318 - Pages: 2

Free Essay


...varias ecuaciones cúbicas de estado. ‘Mas ellas son casos especiales de la ecuación cúbica de estado genérica: RT WV - 17) p= V - b (V-b)(V +¿w+e) (3.42) En ella b, 8, 6, E y 7 son parámetros que en general dependen ¿le la temperatura y, para mezclas, de la composición. Aunque la ecuación (3.42) parece muy flexible, tiene limitaciones inherentes debido a que es cúbica.” La ecuación de RedliddKwong se abtiene de la ecuación (3.42) con 8 = a/T”‘, 77 = S = b y E = 0. Otras formas diferentes de la ecuación (3.42) se obtienen si se hacen sustituciones diferentes; el uso más común de todas ellas tiene que ver con el equilibrio vaporkquiclo (capítulo 13). 5M. M.Abbott,AICL!ZJ.,vol. 19,~~. 596-601, 1973;Arlv. in Chem. Series182,K.C. ChaoyR.1~. Robinson Jc, eds., pp. 47-70, Am. Chem. Soc., Washington, D:C., 1979. 96 CAPhL!JLO 3. *piedades volumétricas de los fluidos puros Las ecuaciones que tienen una exactitud global mayor son necesariamente más complejas, como lo ilustra la ecuación de Benedict/Webb/Rubin: ------- ___. ~.~ _ p- R T : B,RT-A,-C,lT2+óRT-CL V V2 V3 _-._-.-C_ _ C +aa+- V6 V3T2 (3.43) donde Ao, Bo, Co, a, b, c, cy y y son todas constantes para un fluido dado. Esta ecuación y sus modificaciones, a pesar de la complejidad que tienen, se emplean en las industrias del petróleo y del gas natural para hidrocarburos ligeros y algunos otros gases encontrados comúnmente. F$emplo 3.7 La presión de vapor del cloruro de metilo a 60°C es de......

Words: 37868 - Pages: 152

Free Essay


...CASO CEM-CAL CORPORATION Familiarizarse con el caso En Chem-cal Corporation se enfrenta a diez proyectos de inversión que consisten en diferentes inversiones iniciales. Lo cual los directivos tienen distintas formas de evaluación Que lleva a un problema de como poner valores en las diferentes inversiones. La otra gran interrogante es si es necesario elevar el capital para cubrir los proyectos Programados para el próximo año. La compañía tiene 8,2 millones de dólares disponibles Para inversiones de capital este año y los proyectos descritos ascienden a 18.650.000 Millones. Identificar los síntomas Existe una gran duda en el sentido de que tasa usar o escoger lo que implica si es asertivo usar una tasa de descuento apropiada para utilizar el método VPN o utilizar la tasa interna minima con el método TIR. Esta duda lleva a que no se esta logrando lo deseado. Identificar objetivos Uno de los objetivos principales es la valoración de estos proyectos. Chem- Cal Corporation debe volver a calcular el VPN de cada proyecto. Lograr una tasa de capital es decir la mejor opción es el Wacc y ver las fuentes para conseguir los recursos. Análisis de opciones para conseguir más capital - Elevar Ratios de deuda (30% cerca de la media del sector) - Vender bonos de 5 millones de dólares (un poco mas de 10.5%) - Fondo de amortizaciónDiagnostico Encontrar una fuente de financiamiento que no sea superior o igual al 11% y esa tasa seria un 10% para ajustar al wacc ya que...

Words: 420 - Pages: 2

Premium Essay

Ap Chem Stoichiometry

...AP Chemistry Summer Assignment Mr. Ronnenkamp Welcome to SPHS AP Chemistry!! You already have a background in chemistry from your General Chemistry class, but AP Chem is very different. Rather than memorizing how to do particular types of problems, you must really understand the chemistry and be able to apply it to different kinds of problems. AP Chemistry is a challenging course. To succeed, you must keep up with the assignments and be willing to spend time working through the material. Like all AP classes, AP Chem comes with a summer assignment. It is due the second day of class - August 25th - and will count as ½ of a test grade. ALL YOUR ANSWERS FOR THE SUMMER ASSIGNMENT SHOULD BE PUT ON ANOTHER SHEET OF PAPER!!!! We will then have a CLASS TEST on the SUMMER ASSIGNMENT ON 9/1/2015 (depending on schedule)!!! This class test will count as the second ½ of your first test grade. I check my e-mail frequently, so feel free to contact me if you are having problems doing the summer assignment. I can offer help via email. My e-mail address is: Please take the summer assignment seriously. Completing the summer assignment will allow you to enter AP Chemistry in August ready to succeed!!!! Each section of the summer assignment is referenced with web tutorials to help you if you have forgotten some of your General Chemistry, but feel free to use any good website. I will also be giving you access to an online......

Words: 1242 - Pages: 5

Premium Essay


...Rajdeep Singh Chem 2A Fregrene The Evolution of the Battery and Electric Vehicle After reading various articles on battery chemistry and how it applies to electric vehicles’ I have come to a conclusion. Although electric vehicles may seem like a great idea for many people, because they can eliminate a great amount of emission pollutants in the atmosphere, they arrive with many unresolved issues. Issues which may be expensive as well as incovineient to solve. The first article I read was “Chemstry’s Electric Oppurtunity” by Alex Scott. In his article, he spoke of the automobile firm Tesla and their new Model S vehicle. The Tesla Model S is a vehicle capable of driving up to 300 miles before needing to recharge, compared to the majority of other electric cars who can only reach 100 miles. The CEO of Tesla Motors, Elon R. Musk claims that “anything a gasoline based vehicle can do, the Model S can do” (Scott, pg 1). Which may prove to be true since the car goes from ‘0-60 in only 4.2’ (Scott, pg 1). Many people wonder how the Model S is capable of outperforming other electric vehicles. It is due to the car’s large 670kg battery. This battery provides an energy density of 240 Wh/Kg. ‘This is much denser than the nickel based batteries of other firms such as Toyota, Nissan, and GM’ (Scott, pg 2). It’s great that Tesla is able to raise the bar in the electric vehicle field and provide a more efficient vehicle for consumers to enjoy, however there is a large inhibitor. Batteries...

Words: 850 - Pages: 4

Premium Essay


...CHEM 111G – General Chemistry I Lab 1 Separation of the components of a mixture Aim of the experiment: To develop a stepwise procedure to separate the four components of a mixture of sand, salt, iodine and iron filings and determine the % of each by mass Brief procedure: The stepwise procedure was developed based on unique properties of each component: Salt: soluble in water Sand: insoluble in water Iodine: sublimes to vapor Iron: attracted to magnet We weighed out ~2g of the mixture in a 250mL beaker and chose to separate the iron first using a magnet. Since the iron sticks strongly to the magnet, the beaker + mixture was then reweighed to determine the mass of iron removed by difference. The iodine was then removed in the next step by placing the beaker on a hot plate covered by an ice cold evaporating dish and heating at maximum heat until no more purple iodine vapor were seen coming off. The deposited iodine crystals were recovered from the underside of the dish. Because some iodine is lost the beaker + mixture was then reweighed to determine the mass of iodine removed by difference. The remaining mixture of sand and salt was treated with deionized water to extract the salt (soluble). The sand was removed by filtration through a filter funnel via the water vacuum pump and the filtrate transferred to another weighed beaker. The salt was then recovered by evaporating the filtrate to dryness. The beaker was cooled and the salt mass determined by mass......

Words: 373 - Pages: 2

Free Essay


...Molecular Structures Molecular Structures Learning Objectives: - Understand covalent bonding displayed by elements in biological systems - Apply the octet rule - Practice converting molecular formulas into molecular structures - Be able to visualize and draw three dimensional molecular shapes Introduction: The octet rule states that most elements will share or exchange valence electrons in order to achieve a similar electron arrangement to the nearest noble gas. This concept is extremely important because it explains why elements bond to form compounds such as water, electrolytes, DNA, proteins and other biologically important substances. In this lab we will be focusing on a small palette of biologically important elements and studying how they covalently bond. In covalent compounds, the behavior of these elements tends to be consistent and predictable. Group Electron Arrangement Number of Bonds and Lone Pairs 1A 7A 1 bond and no lone pairs H X 6A X = F, Cl, Br or I O O O 6A Version: 3/22/16 S 1 bond and 3 lone pairs in biological systems Oxygen generally has 2 bonds and 2 lone pairs, but may have one bond and 3 lone pairs in anions such as hydroxide, or 3 bonds and 1 lone pair in cations such as hydronium. Sulfur has 2 bonds and 2 lone pairs in biological systems. Page 1 of 8 Molecular Structures 5A N Nitrogen generally forms 3 bonds with 1 lone pair, but may form 4 bonds with no lone pairs in......

Words: 783 - Pages: 4

Free Essay

Chem Ia

...CHEM IA 11 Aim To determine the enthalpy change of reaction between zinc powder and aqueous copper(II) ions Uncertainties of Apparatus Electronic balance | ±0.001g | 50cm3 measuring cylinder | ± 0.5cm3 | Thermometer | ± 0.1oC | Digital stopwatch | ± 0.2s | Mass/g of zinc in weighing bottle measured by electronic balance for Method 1 Mass of Zn (±0.002) / g | 0.9123 | Mass of weighing bottle (± 0.001) / g | 3.5840 | Mass of Zn + weighing bottle ( ±0.001) /g | 4.4963 | Highest temperature recorded after adding Zn to copper (II) sulfate solution for Method 1 Initial temperature (±0.1) / ⁰C | 22.0 | Highest temperature (±0.1) / ⁰C | 31.5 | Temperature change (±0.2) / ⁰C | 8.50 | Mass/g of zinc in weighing bottle measured by electronic balance for Method 2 Mass of Zn (±0.002) / g | 0.9123 | Mass of weighing bottle (± 0.001) / g | 3.5840 | Mass of Zn + weighing bottle ( ±0.001) /g | 4.4963 | Temperature recorded before and after adding Zn is added to copper (II) sulfate for Method 2 Time (±0.2) / s | Temperature (±0.1) / ⁰C | 0.0 | 22.0 | 15.0 | 22.0 | 30.0 | 22.0 | 45.0 | 22.0 | 60.0 | 22.0 | 75.0 | 21.5 | 90.0 | 21.5 | 105.0 | 21.3 | 120.0 | 21.2 | 135.0 | 21.2 | 150.0 | 21.0 | 165.0 | 21.0 | 180.0 | 21.0 | 195.0 | 21.0 | 210.0 | 23.0 | 225.0 | 23.8 | 240.0 | 24.5 | 255.0 | 25.2 | 270.0 | 26.4 | 285.0 | 28.2 | 300.0 | 29.1 | 315.0 | 29.8 | 330.0 | 31.1 | 345.0 | 31.5 | (Highest......

Words: 731 - Pages: 3