rec2_Jan19 - Workshop 2 January 19, 2012 - Fruitful vs....

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Workshop 2 January 19, 2012
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Summary of Workshop - Fruitful vs. Nonfruitful - Parts of a Function (def line, colons, spacing, print vs return) - screenshot activity - Troubleshooting Common Errors Activity - Booleans ( and/or) - Simple Conditional Practice (if,elif, else) - Discuss Piazza & Advice Document - Ask your question on Piazza - If time allows: Quick For Loop Intro
Background image of page 2
Notes for students -Resubmission for hw00 is due January 20th (Friday) at 8pm. -Note that this resubmission will only be for THIS assignment. Do not expect this "safety net" for every mini project and homework assignment. -Mini Project 1 (MP1) is due January 25th (Wed) at 8pm -Jan 27: First QUIZ (Guide is posted)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fruitful vs. Non-fruitful Fruitful- the function returns a value that can be saved and used for something else. Non-fruitful- a function that does what it is supposed to do (print a value, show a picture, etc.) but does not give you anything in return. Throughout this workshop, we will determine if any of the functions we come across are fruitful or non-fruitful.
Background image of page 4
Parts of a Function Syntax requirements: -Must use the "def" keyword to introduce a function. - a colon, ":", is used at the end of the function line. example: def myAwesomeFunction(parameter1): - indentation -print vs. return (can use Fruitful WS)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Parts of a Function- Activity 1. What is the name of the function shown above? 2. What are the keywords in the function 3. What are the parameters given in the function? 4. What is the result being returned? 5. True/False: Indentations don't matter in JES; they're only used to make the code look neat. 6. Label the code block in the function. 7. How many variable assignments are there? What are they?
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

rec2_Jan19 - Workshop 2 January 19, 2012 - Fruitful vs....

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online