Dictionaries and File I/O George Mason University.

Slides:



Advertisements
Similar presentations
Lists and Strings George Mason University. Todays topics Review of Chapter 5: Lists and Strings Go over examples and questions lists and strings in Python.
Advertisements

UNIT 12 UNIX I/O Redirection.
Test Driven Development George Mason University. Today’s topics Review of Chapter 1: Testing Go over examples and questions testing in Java with Junit.
Lecture 2 Introduction to C Programming
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Dictionaries Last half of Chapter 5. Dictionary A sequence of key-value pairs – Key is usually a string or integer – Value can be any python object There.
1 Bacterial Genetics Chapter 8-9. Figure 13.2a.
©Brooks/Cole, 2001 Chapter 13 Binary Files. ©Brooks/Cole, 2001 Figure 13-1.
CS 106 Introduction to Computer Science I 01 / 29 / 2008 Instructor: Michael Eckmann.
1 Session-14 CSIT 121 Spring 2006 Demo due today; demo hint was sent to your campus accounts Demo due today; demo hint was sent to your campus .
INFORMATION ORGANIZATION LAB OCTOBER 6, 2009 Project 2 was due today at noon. If you haven’t sent it to us and haven’t already talked to us, come talk.
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
1 Session-11 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-4 due Now Chapter 4 topics –Using get and ignore to control input data (3-19) –Prompting.
©Brooks/Cole, 2001 Chapter 7 Text Files. ©Brooks/Cole, 2001 Figure 7-1.
CS 117 Spring 2002 What's Next. Files How to get data from a file instead of the keyboard How to save data to a file You know most of this from using.
1 Key Concepts:  Data types in C.  What is a variable?  Variable Declaration  Variable Initialization  Printf()  Scanf()  Working with numbers in.
©Brooks/Cole, 2001 Chapter 11 Strings. ©Brooks/Cole, 2001 Figure 11-1.
Decision Making George Mason University. Today’s topics 2 Review of Chapter 2: Decision Making Go over exercises Decision making in Python.
Lecture 30 Streams and File I/O COMP1681 / SE15 Introduction to Programming.
1 Session-13 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Semantic Scrolling How to navigate structured documents.
Investigate the degree to which programming concepts are interrelated Reshmi Ravi.
1.1 1 Introduction Foundations of Computer Science  Cengage Learning.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 6 Value-Returning.
Test Driven Development George Mason University. Today’s topics Review of Chapter 1: Testing Go over examples and questions testing in Python.
EGR 2261 Unit 9 Strings and C-Strings  Read Malik, pages in Chapter 7, and pages in Chapter 8.  Homework #9 and Lab #9 due next week.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
1 CS161 Introduction to Computer Science Topic #13.
CS 106 Introduction to Computer Science I 01 / 31 / 2007 Instructor: Michael Eckmann.
Introduction Chapter 1 8/31 & 9/1 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
Variables and Expressions CMSC 201. Today we start Python! Two ways to use python: You can write a program, as a series of instructions in a file, and.
1 CSC103: Introduction to Computer and Programming Lecture No 24.
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
Chapter 15 Strings as Character Arrays
Data Types and Conversions, Input from the Keyboard If you can't write it down in English, you can't code it. -- Peter Halpern If you lie to the computer,
Pointer Lecture 2 Course Name: High Level Programming Language Year : 2010.
Debugging and Printing George Mason University. Today’s topics Review of Chapter 3: Printing and Debugging Go over examples and questions debugging in.
MULTI-DIMENSIONAL ARRAYS 1. Multi-dimensional Arrays The types of arrays discussed so far are all linear arrays. That is, they all dealt with a single.
3.4 Strings Variables and Strings Using Text Boxes for Input and Output Concatenation ANSI Character Set String Properties and Methods: LengthToUpper TrimToLower.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic properties and characteristics of external files ❏ To.
Levi Garner. Topics  Computer Storage Devices  Storage Media and Storage Devices  Memory and Storage.
CS 115 OBJECT ORIENTED PROGRAMMING I LECTURE 6_1 GEORGE KOUTSOGIANNAKIS Copyright: FALL 2015 Illinois Institute of Technology- George Koutsogiannakis 1.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the differences between text and binary files ❏ To write programs.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
CS2910 Week 6, Lab Today Dictionaries in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Point Maps Peterson’s Chapter 11 & 12. Points and Point Maps Points – Datum and coordinate systems – geocoding Point Maps – Show where points are (just.
Topic: Binary Encoding – Part 1
Chapter 7 Text Input/Output Objectives
Topics discussed in this section:
Chapter 7 Text Input/Output Objectives
Chapter 1 Introduction to Java
CS 116 OBJECT ORIENTED PROGRAMMING II MIDTERM EXAM INFORMATION
Week of 12/12/16 Test Review.
Use of Java’s HashMap.
Topic: Python’s building blocks -> Variables, Values, and Types
Chapter 7 Text Input/Output Objectives
Week 1, Day 4 Snakes Alive 31 June 2016.
Hire Toyota Innova in Delhi for Outstation Tour
INF 231 Enthusiastic Study/snaptutorial.com
Use proper case (ie Caps for the beginnings of words)
Input and Output with FILES
Exercise Solution First questions What's output What's input
CS150 Introduction to Computer Science 1
Appending or adding to a file using python
Multi-Dimensional Arrays
Python Programming Mr Scicluna.
Topics discussed in this section:
Presentation transcript:

Dictionaries and File I/O George Mason University

Today’s topics Review of Chapter 7: Maps Go over examples and questions maps in Python using files

Maps review What is a map? How is it different than a list? How do you declare a map? How do you get the keys of a map? Values? What is a method?

Let’s go over the exercises

Maps (dictionaries) in python

File Input/Output A file is stored data available through the help of the operating system So far, we have received user input through the keyboard with input( ) – there isn’t always a user there! Need to open the file, then get its contents – We like to store contents as a string, or list of strings Course outcome: look up how to open a file and read its contents on your own – use Google – use the documentation – demo with figuring out how to get keyboard input

Questions?