EGR 103/Fall 2018/Lab 5
Errors / Additions
None yet!
5.1 Introduction
The main purpose of this lab will be to look at debugging, list comprehensions, and loading data from files. There is also some string manipulation and turtles!
5.2 Resources
See main EGR 103 page for links to these
5.3 Getting Started
Same as it ever was.
%.4 Ungraded
These problems are good ones to look at and to solve but are not a part of the graded work. Given that, you can absolutely consult with classmates about how to get the answers to these ungraded problems but you may not share those answers outside of the members of the class.
5.5 Useful Information
String and List Functions
This section discusses some of the most common functions applied to strings or to lists.
Debugging Introduction
This section is a follow on from class. See the videos at:
- Using Breakpoints in Spyder - Albert Schuelle showing how to use breakpoints
- Flow of Execution - Albert Schueller debugging a turtle program
Spring 2018 APTs
We will be using Algorithmic Problem-solving Testing (APT) problems, some of which were deployed for the Spring 2018 version of CS 101.
- All the APTs are available at: CompSci 101 Spring 2018 APT Grading
- Programs can have an
import math
line but cannot import numpy and cannot import math as m - you have to use all of math.
Turtles
We went over the basics of turtles in class - more information is at Python:Turtles
5.6 Assignment
5.6.1 APT
For lab, you need to complete at least 8 of the 10 listed APTs by the end of lab; you need to complete all 10 by Friday October 12. Each of these is useful in terms of preparing for the midterm. For MorseLikeCode in particular, you need to figure out how best to build and use a dictionary.
5.6.2
Focus on how you would draw the curve and then how to program it. This is best done with recursion - the level 0 code is already done. The level 1 curve is built of four shorter and angled level 0 curves. Once you get that part working, you should be able to create any level of curve.
5.6.3
This problem takes you step by step through developing the code. Pay careful attention to the tests it recommends that you run. Put those tests in your script either in a main() function that gets called or in a selective executable based on whether __name__ is "__main__". Also look at the test code - make sure you understand what it is doing and how it works.
5.6.4
This is similar to 5.6.3. Including the part about looking at the test code and seeing how it works.