CompSci 101 Introduction to Computer Science

Slides:



Advertisements
Similar presentations
CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
Advertisements

CompSci 101 Introduction to Computer Science Feb 26, 2015 Prof. Rodger.
CompSci 101 Introduction to Computer Science January 20, 2015 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science September 23, 2014 Prof. Rodger.
CompSci 101 Introduction to Computer Science Sept. 9, 2014 Prof. Rodger President Brodhead speech graduation 2010 CompSci 101 Fall
CompSci 6 Introduction to Computer Science November 1, 2011 Prof. Rodger.
CompSci 6 Introduction to Computer Science Sept 29, 2011 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not.
CompSci 101 Introduction to Computer Science November 18, 2014 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 3, 2015 Prof. Rodger compsci101 spring151.
CompSci 6 Introduction to Computer Science September 13, 2011 Prof. Rodger.
Compsci 101.2, Fall Plan for TDAFB (after fall break) l Hear via about plans to catch-up and stay-ahead  Profs. Rodger and Astrachan to.
CompSci 101 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam.
CompSci 101 Introduction to Computer Science February 10, 2015 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
Compsci 101.2, Fall Plan for WEFWOO l Review for exam, studying and practicing for exams and APTs in Compsci 101  Why memorization doesn't help.
CompSci 101 Introduction to Computer Science Feb 24, 2015 Prof. Rodger.
CompSci 6 Introduction to Computer Science Sept. 20, 2011 Prof. Rodger CompSci 6 Fall
CompSci 101 Introduction to Computer Science February 11, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science November 11, 2014 Prof. Rodger CompSci 101 Fall Review for exam.
CompSci 101 Introduction to Computer Science March 17, 2015 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science February 25, 2016 Prof. Rodger compsci101 spring20161.
CompSci 6 Introduction to Computer Science September 27, 2011 Prof. Rodger CompSci 6 Fall
CompSci 101 Introduction to Computer Science February 16, 2016 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CompSci 101 Introduction to Computer Science April 7, 2015 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 24, 2016 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science March 8, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science April 14, 2016 Prof. Rodger Lecture today by Sriram Vepuri.
CompSci 101 Introduction to Computer Science March 1, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 29, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science February 5, 2015 Prof. Rodger Lecture given by Elizabeth Dowd compsci101 spring151.
CompSci 101 Introduction to Computer Science Sept 13, 2016 Prof. Rodger compsci101 fall161.
CompSci 4 Java 1 Apr 2, 2009 Prof. Susan Rodger. Announcements Assignment 7 questions? –Beware having two events that kick in at the same time! –Beware.
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Python: Control Structures
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Using MyMathLab Features
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Tips for the on-line comprehensive Pre and Post Test
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Introduction to Computer Science
Writing Methods AP Computer Science A.
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Using CourseCompass Features
AP Computer Science A 2/6/2018.
CMSC201 Computer Science I for Majors Lecture 12 – Midterm Review
CompSci 101 Introduction to Computer Science
Presentation transcript:

CompSci 101 Introduction to Computer Science Feb 23, 2017 Prof. Rodger compsci101 spring 2017

Announcements Reading and RQ 11 due next time APT 4 is due on Tuesday Today: A different way to process elements List comprehension Coming – more ways to process data Exam 1 back compsci101 spring 2017

Giving Back Exam 1… on Gradescope Solutions posted – regrades til March 3 Ask for regrade on gradescope Try working problem you missed first Then look at solution Once you think you understand Get blank sheet of paper – try again Understand all solutions compsci101 spring 2017

86 86 86 86 85 85 85 85 85 85 85 84 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 83 83 83 82 82 82 82 82 82 82 82 82 82 82 82 81 81 81 81 81 81 81 81 81 81 81 80 80 80 80 80 80 80 80 80 80 80 80 80 79 79 79 79 79 79 79 79 79 79 79 79 79 78 78 78 78 78 78 78 78 78 78 77 77 77 77 77 77 77 77 76 76 76 76 76 76 76 76 76 76 76 76 75 75 75 75 75 75 75 75 74 74 74 74 74 74 74 74 74 74 74 74 74 74 73 73 73 73 73 73 73 73 72 72 72 72 72 72 72 72 72 72 72 72 71 71 71 71 71 71 71 71 70 70 70 70 70 70 70 69 69 69 69 69 69 69 68 68 68 68 68 68 68 67 67 67 66 66 66 66 66 66 65 65 65 65 65 65 65 65 65 64 64 64 64 64 63 63 63 63 63 63 62 62 62 62 62 62 62 Exam 1 scores 61 60 59 58 58 57 57 57 56 55 55 55 55 54 54 53 52 50 48 48 47 46 45 45 44 42 42 42 42 40 40 38 35 34 32 26 24 23 compsci101 spring 2017

}Wow }Yes }Ok }Ok Exam 1 scores Get Tutor 86 86 86 86 85 85 85 85 85 85 85 84 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 83 83 83 82 82 82 82 82 82 82 82 82 82 82 82 81 81 81 81 81 81 81 81 81 81 81 80 80 80 80 80 80 80 80 80 80 80 80 80 79 79 79 79 79 79 79 79 79 79 79 79 79 78 78 78 78 78 78 78 78 78 78 77 77 77 77 77 77 77 77 76 76 76 76 76 76 76 76 76 76 76 76 75 75 75 75 75 75 75 75 74 74 74 74 74 74 74 74 74 74 74 74 74 74 73 73 73 73 73 73 73 73 72 72 72 72 72 72 72 72 72 72 72 72 71 71 71 71 71 71 71 71 70 70 70 70 70 70 70 69 69 69 69 69 69 69 68 68 68 68 68 68 68 67 67 67 66 66 66 66 66 66 65 65 65 65 65 65 65 65 65 64 64 64 64 64 63 63 63 63 63 63 62 62 62 62 62 62 62 Exam 1 scores }Ok 61 60 59 58 58 57 57 57 56 55 55 55 55 54 54 53 52 50 48 48 47 46 45 45 44 42 42 42 42 40 40 38 35 34 32 26 24 23 }Yes Get Tutor Get a tutor – peer tutor. We will try to do some matching up with UTAs. }Ok compsci101 spring 2017

compsci101 spring 2017

Alice programming language alice.org, Alice version 2.4 See folder AliceDemos/TheFair/ for Alice Worlds compsci101 spring 2017

Nested Loop compsci101 spring 2017

Fair Ride – Octopus compsci101 spring 2017

Wac-A-Mole compsci101 spring 2017 How is wac a mole implemented? A list of moles, go through and check if what you clicked on is in the list compsci101 spring 2017

Problem: Find the first duplicate adjacent words in a phrase “Did I make make a mistake in in this?” Convert to list Answer is 2, (start counting at 0) make make compsci101 spring 2017

Bit.ly/101s17-0223-1 compsci101 spring 2017

APTs solved in a similar way NameGroup Pikachu compsci101 spring 2017

APTs solved in a similar way NameGroup Pikachu compsci101 spring 2017

Creating a list Given a list of numbers, create a second list of every number squared. nums = [8, 3, 5, 4, 1] sqnums = [] for v in nums: sqnums.append(v*v) print sqnums [64, 9, 25, 16, 1] Talk about append. It modifies the list. Note there is not a return value. Also note that it is a function that is applied to the list – notice the dot Nameoflist.function We have functions compsci101 spring 2017

More on List operations Previous page nameOfList “dot” function (parameter) sqnums.append(v*v) See list operations on next page Mutator vs hybrid vs return Mutator changes the list (no return value) Hybrid changes list and returns value Return – returns value, no change to list compsci101 spring 2017

List operations from book compsci101 spring 2017

Problem Remove all negative numbers from list [4, -2, 5, 6, -3]  [4, 5, 6] Two ways 1) return a new list with all negative numbers removed 2) Modify a list to remove negative numbers compsci101 spring 2017

www.bit.ly/101s17-0223-2 somenums = [3, -1, 8, -5, -2, 6, 7] nonegs = removeNegatives(somenums) compsci101 spring 2017

www.bit.ly/101s17-0223-3 somenums = [3, -1, 8, -5, -2, 6, 7] removeNegatives2(somenums) compsci101 spring 2017

www.bit.ly/101s17-0223-4 somenums = [3, -1, 8, -5, -2, 6, 7] removeNegatives3(somenums) compsci101 spring 2017

Solving problems – APT MorseLikeCode Compare find vs index find with string – returns -1 when not found index with list – CRASHES if not there! You can’t say: pos = alist.index(“…”) Instead: if “…” in alist: pos = alist.index(“…”) How to get started? What do you do instead? If “…” in alist, then set pos Started? Consider writing a function helper cps101 fall2016