1 Page

quiz5Solution

Course: CSC 103, Fall 2009
School: Union College
Rating:
 
 
 
 
 

Document Preview

Quiz CSC-103 October 28, 2008 Name: Using string methods, write expressions that do the following: 1. Capitalize 'boolean' >>> 'boolean'.capitalize() 'Boolean' >>> 2. Find the first occurrence (report the index) of '2' in 'CO2 H2O' >>> 'CO2 H2O'.find('2') 2 >>> 3. Find the second occurrence (report the index) of '2' in 'CO2 H2O'...

Register Now

Unformatted Document Excerpt

Coursehero >> Nebraska >> Union College >> CSC 103

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Quiz CSC-103 October 28, 2008 Name: Using string methods, write expressions that do the following: 1. Capitalize 'boolean' >>> 'boolean'.capitalize() 'Boolean' >>> 2. Find the first occurrence (report the index) of '2' in 'CO2 H2O' >>> 'CO2 H2O'.find('2') 2 >>> 3. Find the second occurrence (report the index) of '2' in 'CO2 H2O' >>> 'CO2 H2O'.find('2',3) # start at search index 3, past the first occurrence 5 >>> 4. Determine whether 'Boolean' begins with lowercase >>> 'Boolean'[0].islower() False >>> 5. Convert 'MoNDaY' to lowercase letters and then capitalize the result. &g...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Union College - CSC - 103
CSC-103 Handout String functions and methods string concatenation string character access substrings length function + [] <string>[<start>:<end>] len(<string>)String methods applied using the form <string>.<method>( ) capitalize() upper() lower() s
Union College - CSC - 103
In class exercises If Statements September 30, 2008 1. Let's say you have two float variables, population and land_area. a) Write an if statement that will print the population if it is less than 10,000,000 if population < 10000000: print "population
Union College - CSC - 103
CSC-103 Intro to Computational Science Quiz 4 October 8, 2008Name:1. Complete the following function. The function asks the user for the diameter of a pizza and the price of the pizza. It then will compute and print the cost per square inch of th
Washington - PH - 225
Union College - ESC - 100
ESC100 Design Studio Project Challenge PresentationDuring the challenge each team will give a 2 minute presentation to the judges. This presentation must include a detailed sketch or picture of the final design, a brief description of design featur
Washington - PHYS - 122
Name, student#_Physics 122A Winter 2005 Exam 2 Friday, February 11, 2005Name _solution_ _ last first Signature _Time: 9:30-10:20 Seat NumberStudent ID Number _READ THIS ENTIRE PAGE NOW, BEFORE THE HALF-HOUR BELL. Do not open the exam before
Washington - SOC - 110
Review Social Movements and Social ChangeTheprisonersdilemmamodel showsthatwhenthereis competitionforscarceresources,behaviorthatisrational attheindividuallevelleadstosuboptimaloutcomesat theaggregate,orgrouplevel. Acollectivegood issomethingthat,if
Washington - VN - 981
Washington - BIOL - 481
Received 22 January 2002 Accepted 30 January 2002 Published online 1 May 2002Timing of transmission and the evolution of virulence of an insect virusVaughn S. Cooper1*, Michael H. Reiskind1, Jonathan A. Miller2, Kirsten A. Shelton3, Bruno A. Walth
Washington - BIOL - 481
Local Interactions Select for Lower Pathogen Infectivity Michael Boots, et al. Science 315, 1284 (2007); DOI: 10.1126/science.1137126 The following resources related to this article are available online at www.sciencemag.org (this information is curr
N.C. State - ST - 740
x[]cen[]NA1250NA1552NA1144NA1476NA1257NA1550NA892NA1517NA1483NA1405NA1118NA1143NA1584NA1633NA1313NA1531NA1301NA1620NA1382NA1104NA1360NA1707NA871NA1606NA1227NA1523NA1005NA1425NA1447NA1458NA
Washington - COM - 306
DAYS AGENDA The media and the political spectacle o How the media construct problems o How the media construct enemies Consuming the media o Stuart Halls encoding-decoding model o Reading positions & social positionsMURRAY EDELMANS (1988) THESIS
N.C. State - MA - 780
MA 780 Homework #4, Part II Due Friday, April 11 1. Using Gauss-Chebyshev and Gauss-Hermite integration formula to show that1 -1 -xm dx = 1 - x2 e-x xm dx =2 nn i=1cosm(2i - 1) , 2nnif m 2n - 1; 2n+1 n! xm i (Hn (xi )i=12i
N.C. State - AEE - 523
N.C. State - AEE - 578
EthnographyEthnography Ethno refers to human culture Graphy means description ofEthnography A research process used in the scientific study of human interactions in social settings Used extensively in anthropology Has become increasing pop
N.C. State - P - 151
N.C. State - ECE - 406
Lecture NotesCourse Number: Instructor: Date: Lecture Number: ECE 406 Ben Heard 2/16/09 102009North Carolina State University - All Rights ReservedUntitledFebruary 16, 2009AutoSave1UntitledFebruary 16, 2009AutoSave2Untitled
Washington - CHEM - 165
Chemistry 16522-1Chapter 22: The Halogens and the Noble GasesThe halogens (group VII) are the most reactive of the non-metallic elements. They are all oxidizing agents (easily reduced) and are found in nature only in combination with other eleme
NYU - PJK - 233
Chaper 4: Stereochemistry of of Alkanes and Cycloalkanes A model system-Ethane (CH3CH3):The different forms of ethane can be achieved by rotating the front or rear carbon 60 degrees, the staggered confirmation is more stable due to the decreased tor
N.C. State - ARE - 306
http:/www.aoc.state.nc.us/www/public/coa/opinions/2002/unpub/011415-1.htm A decision without a published opinion is authority only in the case in which such decision is rendered and should not be cited in any other case in any court for any other pur
N.C. State - BCH - 455
Gene Isolation This is beyond the scope of this class so assume it is easy! From this point its pretty straightforward to express it and make large quantities of the protein for which it codes. The segment of DNA corresponding to the coding regio
N.C. State - BCH - 455
ProteinsThey are a relatively homogeneous class of molecules. All are the same type of linear polymer built of various combinations of the same 20 amino acids differing only in the sequence. Their functional diversity lies in the threedimensi
NYU - ECON - 1988
NYU - MA - 240
September 9, 2005 MA 240 Paul E. HandHW 1Due: September 16, 2005 in class1.) a.) The slope field for y = 1 + y looks like the following.As the ODE is separable we write dy = dx 1+y x y d = d 1+ log |1 + y| = x + c y = -1 + ex+c By inspecting t
NYU - MA - 401
February 22, 2006 MA 401 Paul E. HandHW 5: The Heat EquationDue: March 2, 2006 in class1. Consider the ODE y + y = g(x) y (0) = 0 y (L) = 0 (a) Expand y and g into a cosine series. Solve for y(x). (b) Are there values of for which your solution
NYU - MA - 401
January 26, 2006 MA 401 Paul E. HandHW 2: Dirac DeltaDue: February 2, 2006 in class1. (a) What is (b) Express (c) What is 2x - (x - 5)e dx? x 2 s - s (s + 1) + e (s - 1)ds in x - (4x)e dx? Hint: let y = 4xterms of Heaviside functions.(d)
NYU - MA - 240
1) If y' + E y = 0, and y(0)=0 and y(1)=0. Find the general solution to this ODE (when E is a constant). Enforce the Boundary Conditions. What values of E allow for a non-zero solution to this ODE.2) y' = -(x^2-y)/(y^2-x)3) y' + y/(4 x^2) = 0
NYU - ENGLISH - 1110
Spring 2007 Study Abroad CoursesV41 courses offered through NYU's Study Abroad programs may be counted toward the English major. These courses may be used to fulfill the advanced elective requirement except where noted below. With advisor approval,
NYU - ENGLISH - 1110
Updated: 11/10/05Undergraduate English Spring 2006 Course DescriptionsV41.0060 Major British Writers Assumes no prior work in literature. Recommended for English minors and non-majors. This class will study a mixture of highly canoncial writers su
N.C. State - MA - 796
MA796S/OR791K: Convex Programming and Interior Point Methods Homework 3 Instructor: Dr. Kartik SivaramakrishnanINSTRUCTIONSDue in class on Thursday, October 18, 2007. You can work in groups of 2-3 students and submit the entire assignment as a gro
N.C. State - MAE - 315
N.C. State - MAE - 315
N.C. State - MAE - 315
HOMEWORK #2
N.C. State - MAE - 315
Allan Hancock College - STAT - 3361
The University of Western Australia School of Mathematics & Statistics STAT3361 RANDOM PROCESSES & APPLICATIONS Practice Exercises 2 AND Assignment 1 (2009)Questions for the rst assignment are on page 3. Submit solutions by 6pm Friday 4th April. 1.
Allan Hancock College - PHYSICS - 89682
School of Physics Safety Committee MeetingDate of Meeting: Place of Meeting: Present: Apologies: Minutes 1. Purchasing Procedures There was a situation late last year where a box containing radioactive material was left sitting on the counter in the
Allan Hancock College - CITS - 2232
This lectureDatabases - Relational Algebra IIThis lecture continues queries in relational algebra.(GF Royle, N Spadaccini 2006-2009)Databases - Relational Algebra II1 / 27(GF Royle, N Spadaccini 2006-2009)Databases - Relational Algebra I
NYU - FVB - 201
Efciency, Equilibrium, and Asset Pricing with Risk of DefaultFernando Alvarez and Urban J. Jermann Econometrica, 2000Efciency, Equilibrium, and Asset Pricing with Risk of Default p. 1/13Outline of the talkComplete markets with risk of default.
N.C. State - MA - 580
MA580 Homework 7 (due 11 March in class)Read sections 3.1 and 3.2.3 in the book by Demmel, and sections 6.1 and 9.6 in the book by Higham & Higham. 1. (10 points) Let x be a real m 1 vector and y a real n 1 vector. Show that xy T 2 = x 2 y 2 . 2.
N.C. State - ENGR - 506
CSC506 Pipeline Homework due Wednesday, June 9, 1999Question 1. An instruction requires four stages to execute: stage 1 (instruction fetch) requires 30 ns, stage 2 (instruction decode) = 9 ns, stage 3 (instruction execute) = 20 ns and stage 4 (stor
N.C. State - ARE - 306
All opinions are subject to modification and technical correction prior to official publication in the North Carolina Reports and North Carolina Court of Appeals Reports. In the event of discrepancies between the electronic version of an opinion and
W. Alabama - CS - 446
containssystem framework package libraryusesis-asubsystemmoduleclassplug-in programproceduretoolapplicationSE-2 Assignment 5 Possible Solution
NYU - VT - 246
New York University Department of Economics Intermediate Macroeconomics V31.0012.002 Vicente Tuesta July 30, 2002Problem Set 4(Due: Tuesday, August 6) Chapter 14: Expectations: The Basic Tools: question 1 and 6. For the true/false question (questi
NYU - AS - 4760
THE SEARCH FOR THE VOICE OF THE PEOPLE: SOCIAL WELFARE POLICY OPINIONS AND POLITICAL EQUALITY IN AMERICA1Adam J. Berinsky Department of Politics Princeton University e-mail: berinsky@princeton.edu January 2001FOR MANY HELPFUL DISCUSSIONS REGARDIN
NYU - POLITICS - 4760
THE SEARCH FOR THE VOICE OF THE PEOPLE: SOCIAL WELFARE POLICY OPINIONS AND POLITICAL EQUALITY IN AMERICA1Adam J. Berinsky Department of Politics Princeton University e-mail: berinsky@princeton.edu January 2001FOR MANY HELPFUL DISCUSSIONS REGARDIN
NYU - CBS - 242
From: Carola Saba To: Ahmad Kamal New York University Oct. 6, 2003 NYU-UN-CBS-A2POVERTY VERSUS TERRORISM IN TRODUCTION The purpose of this paper is to critically examine two current planetary emergencies, the need to reduce poverty and the need to
NYU - GS - 506
Competition and Inter-Firm Credit: Theory and Evidence from Firm-level Data in IndonesiaGiovanni Serio New York University November 15, 2005Abstract Trade credit is one of the main sources of financing for firms in both developing and developed co
NYU - ECON - 1987
NYU - AS - 1638
2009 SUMMER HOUSING APPLICATION YIVO YIDDISH PROGRAMNAME (last, first, MI): _ Have you ever lived in NYU Housing?SEX: M FBIRTHDATE (mm/dd/yy): _ / _ / _ Yes NoSocial Security Number: __ Cell Phone: _ Current Address & Telephone Number S
NYU - AS - 1647
2008 SUMMER HOUSING APPLICATION YIVO YIDDISH PROGRAMNAME (last, first, MI): _ Have you ever lived in NYU Housing?SEX: M FBIRTHDATE (mm/dd/yy): _ / _ / _ Yes NoSocial Security Number: __ Cell Phone: _ Current Address & Telephone Number S
East Los Angeles College - COMS - 11300
Extending Lists: TreesA list: a linear datastructure A list has a head, and a tail. What about a data structure with a head and two tails. This structure is called a Binary Tree Indeed, you can have something with a head and n tails, a n-ary tree. C
RPI - BIOL - 4750
JCB: ARTICLEMyobroblast contraction activates latent TGF-1 from the extracellular matrixPierre-Jean Wipff,1 Daniel B. Rifkin,2 Jean-Jacques Meister,1 and Boris Hinz11 2Laboratory of Cell Biophysics, Ecole Polytechnique Fdrale de Lausanne, CH-10
RPI - ASTR - 4240
The Original Weber Bar Detector Aluminum bar detectors. L=2 m, R=1 m, M=1200 kg. 0 = 1.7 kHz. Q = 3 x 106. Thermal noise: 10-16 m (claimed). 1969 1987 claimed many events. But none ever confirmed. Read more at: http:/focus.aps.org/story/v16
RPI - ASTR - 4240
Gravitation & Cosmology - ASTR-4240 General Relativity - PHYS-4961 Class 16 Gravity Wave DetectorsExercise (30 pts)Table 5.4 says that a supernova at distance r = 10 kpc will produce gravitational waves with A 10-18 . This estimate is attributed
N.C. State - MA - 580
MA580 Homework 8 (due 18 March in class)Read section 3.4 in the book by Demmel. 1. (10 points) Let A be the 51 50 Luchli matrix gallery(lauchli,50). a Let b the column vector with elements bi = i, 1 i 51, and let c be the column vector with eleme
N.C. State - MA - 722
Homework 3MA 722 Spring 2009 Deadline: Friday, March 20th 1. [CLO98, Ch 3. 3. Exercise 10.] The goal of this exercise is to give a formula for Res(1,1,d) for and d > 0. The idea is to apply the Poisson Product Theorem when the eld k consists of rati
N.C. State - MA - 522
Homework 2MA 522 Fall 2003 1. (a) Show that an otherwise polynomial-time algorithm that makes at most a constant number of calls to polynomial-time subroutines runs in polynomial time; (b) Show that a polynomial number of calls to polynomial time su
RPI - BIOL - 4550
Bioinformatics 2 - lecture 20 Protein design - the state of the artProtein folding/ protein designfoldingsequencestructuredesignSequence space maps to structure spacesequence families fold.as many-to-one.Short history of protein desi
N.C. State - PY - 810
PHYSICAL REVIEW C 71, 055502 (2005)Measurement of the neutron lifetime by counting trapped protons in a cold neutron beamJ. S. Nico, M. S. Dewey, and D. M. GilliamNational Institute of Standards and Technology, Gaithersburg, Maryland 20899, USA
N.C. State - MB - 451
104_new515F.abi - Avg. Quality: 0.0A:26%, C:21%, G:28%, T:21%, N:42, Total: 993NNNN NN N NN N N10N AN C G G N NN N20N GC T C G NN N N N N G G30G A AT N N T G G G T T TA A A G G GT C C G T A G G C G G T T T G G T A A G40 50 60 70G T C
East Los Angeles College - PHYS - 2024
Appendix A Order O(.)The order O(.) is a notation often used when discussing the behaviour of a function around a certain value. The O stands for the order and quantifies what has been neglected by a certain approximation. We shall simply provide tw