Download presentation
Presentation is loading. Please wait.
Published byVivian Caldwell Modified over 9 years ago
1
Compsci 101.2, Fall 2015 11.1 Plan for WEFWOO l Review for exam, studying and practicing for exams and APTs in Compsci 101 Why memorization doesn't help so much Why familiarity does help What's a flashcard for Compsci 101? Bring writing utensils only, we provide reference l Algorithms, Python, Idioms, Practice How do you learn to speak a language? How do you learn to use a computer language?
2
Compsci 101.2, Fall 2015 11.2 Writing functions with formulae http://bit.ly/101fall15-929-1
3
Compsci 101.2, Fall 2015 11.3 Writing functions with formulae http://bit.ly/101fall15-midpractice-2 l Using extra variables: can be really smart Helps in making each line simple Easy to correct if you've made a mistake See triangleArea, what about other math symbols and formula? What do +, -, *, /, % do? What about math.sqrt or 5**0.5 or math.sin …
4
Compsci 101.2, Fall 2015 11.4 Accumulating in a loop l If you are going to return a string Initialization, return value, how to "build it" l If you are going to return an int (counter) Initialization, return value, how to "build it" l If you are going to return a list Initialization, return value, how to "build it"
5
Compsci 101.2, Fall 2015 11.5 Counting 'a's in a string, 'fox' in a list? l What Python functions/methods help If you forget, how can you recreate yourself? See exam Python reference sheet l How to write acronym function? Write/sketch and share solution
6
Compsci 101.2, Fall 2015 11.6 Basic File Processing http://bit.ly/101fall15-929-2
7
Compsci 101.2, Fall 2015 11.7 Basic File Processing l GroceryBagger.py, third question File processing: read as string, read line by line Reading strings, how to.strip(),.split(), convert? l Being a good programming citizen Clean up after yourself with closing files Remember that files are read a strings How to convert to numbers? http://bit.ly/101fall15-midpractice-2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.