Nate Brunelle Today: Lists

Slides:



Advertisements
Similar presentations
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Advertisements

Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
Programming Languages Section 1 1 Programming Languages Section 1. SML Fundamentals Xiaojuan Cai Spring 2015.
Enquiry Progress Give your vendor code In case of incorrect vendor code / no id registered with us, you will get this error message In case of correct.
CS16 Week 2 Part 2 Kyle Dewey. Overview Type coercion and casting More on assignment Pre/post increment/decrement scanf Constants Math library Errors.
Lists Introduction to Computing Science and Programming I.
Debugging Introduction to Computing Science and Programming I.
Improving structure with inheritance
CS 280 Data Structures Professor John Peterson. Phase 2 We’re moving on from array-based to link- based structures. You already have experience with links.
CS201 - Laboratory Submittal Using the submit command.
Programming Lecture #3 CS 101 Autumn 2006 Tariq Jadoon.
1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 8 focuses on: array declaration and use passing arrays and array.
CS Jan 2007 Chapter 3: sections Variable initialization Variables may be initialized when declared –Form; type name = initial_value; –Example:
How to Debug Debugging Detectives Debugging Desperados I GIVE UP! MyClass.java.
MAT 1000 Mathematics in Today's World Winter 2015.
CIT 590 Intro to Programming Lecture 4. Agenda Doubts from HW1 and HW2 Main function Break, quit, exit Function argument names, scope What is modularity!
Java Data Types Assignment and Simple Arithmetic.
Scope, Aliasing, Tuples & Mutability Intro2CS – week 4a 1.
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
Debugging Watch and Text Output Alice. Debugging Techniques Several techniques are helpful in eliminating errors (bugs) in programs: careful design incremental.
 To find the numerical value of the expression, simply substitute the variables in the expression with the given number. Evaluate: 2x + 7, if x = 4 Substitute.
Testing Programs with Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Improving structure with inheritance Main concepts to be covered Inheritance Subtyping Substitution Polymorphic variables © 2017 Pearson Education,
Multiplication Timed Tests.
Python Aliasing Copyright © Software Carpentry 2010
Wrapper Classes Debugging Interlude 1
Program Design Invasion Percolation: Aliasing
Programming for Engineers in Python
ASSIGNMENT NO.-2.
The UK Tier 1 Entrepreneur Visa and the UK Representative of Overseas Business Visa - SmartMove2UK
PSP Class Practice 1 MARCIA begins work her program [10:00] by reviewing the requirements in the assignment package, including the test requirements, to.
CANON PRINTER canon printer error code list canon printer problems ink canon printer error code b200 how to fix canon printer not responding.
Lists Part 1 Taken from notes by Dr. Neil Moore & Dr. Debby Keen
Binary Code  
Lists Part 1 Taken from notes by Dr. Neil Moore
Nate Brunelle Today: Pseudo-Code, Party
Final Review Dr. Xiaolin Hu.
Use proper case (ie Caps for the beginnings of words)
Nate Brunelle Today: PyCharm
Nate Brunelle Today: Repetition, A Trip To The Moon
CS1110 cs1110.cs.Virginia.edu Nate Brunelle.
COS 260 DAY 18 Tony Gauvin.
Macro Variable’s scope
Nate Brunelle Today: Slicing, Debugging, Style
Nate Brunelle Today: Functions again, Scope
CS2011 Introduction to Programming I Arrays (I)
Nate Brunelle Today: Turtles
Lists Part 1 Taken from notes by Dr. Neil Moore
Nate Brunelle Today: Values and Types
Nate Brunelle Today: Lists
Final Review Fan Bai Csc 2310 Spring 2012.
Tuples.
Nate Brunelle Today: Functions
Monday, October 17: CS AP A Assignment -Create a netbeans Project with 3 class files. -create a method in each of the two class files you create.
Nate Brunelle Today: Strings, Type Casting
Nate Brunelle Today: Values and Types
Nate Brunelle Today: Conditional Decision Statements
How to fix Juno Error code 49? Dial: +1(844)
A simple function.
For Tutors Introduce yourself.
Small Basic Programming
Errors.
Nate Brunelle Today: Dictionaries
Nate Brunelle Today: Functions
Nate Brunelle Today: Style, Collections
Nate Brunelle Today: Strings, Type Casting
Nate Brunelle Today: Functions again, Scope
Nate Brunelle Today: Web Reading
Types of Errors And Error Analysis.
Nate Brunelle Today: Pseudo-Code
Presentation transcript:

Nate Brunelle Today: Lists CS1110 Nate Brunelle Today: Lists

Questions?

How to swap temp = lst[-1] Lst[-1] = lst[0] Lst[0] = temp

Last Time Nested lists Aliasing

Identity, Alias Alias: another name for the same thing

New lists vs. Aliasing Creates a new list: Creates an Alias: List-builder: [x, y, z] Slicing: mylist[start:end:step] Casting: list(collection) Creates an Alias: Assignment: mylist = myotherlist Invoking a function: func(mylist)

Tips for fixing bugs in code Know what your code should do Read error messages Believe the error message Print every variable Binary search Test more

Binary search begin Line1 Line2 Line3 Line4 Line5 end Print all the variables Line2 Line3 Was it correct (if so, the problem is later) , or incorrect (if so the problem was earlier? Line4 Line5 end