Python Open source Many applications Python 3 jupyter notebook

Slides:



Advertisements
Similar presentations
Course A201: Introduction to Programming 10/28/2010.
Advertisements

CHAPTER 4 AND 5 Section06: Sequences. General Description "Normal" variables x = 19  The name "x" is associated with a single value Sequence variables:
Chapter 6 Lists and Dictionaries CSC1310 Fall 2009.
String and Lists Dr. Benito Mendoza. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list List.
Guide to Programming with Python
DICTIONARIES. The Compound Sequence Data Types All of the compound data types we have studies in detail so far – strings – lists – Tuples They are sequence.
Lists Introduction to Computing Science and Programming I.
COMPUTER SCIENCE FEBRUARY 2011 Lists in Python. Introduction to Lists Lists (aka arrays): an ordered set of elements  A compound data type, like strings.
Data Structures in Python By: Christopher Todd. Lists in Python A list is a group of comma-separated values between square brackets. A list is a group.
Handling Lists F. Duveau 16/12/11 Chapter 9.2. Objectives of the session: Tools: Everything will be done with the Python interpreter in the Terminal Learning.
Built-in Data Structures in Python An Introduction.
And other languages….  Array literals/initialization a = [1,2,3] a2 = [-10..0, 0..10] a3 = [[1,2],[3,4]] a4 = [w*h, w, h] a5 = [] empty = Array.new zeros.
Data Collections: Lists CSC 161: The Art of Programming Prof. Henry Kautz 11/2/2009.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 9 Dictionaries and Sets.
Lists CS303E: Elements of Computers and Programming.
Guide to Programming with Python Chapter Five Lists and dictionaries (data structure); The Hangman Game.
7. Lists 1 Let’s Learn Saenthong School, January – February 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Python Data Structures By Greg Felber. Lists An ordered group of items Does not need to be the same type – Could put numbers, strings or donkeys in the.
Introduction to Programming Oliver Hawkins. BACKGROUND TO PROGRAMMING LANGUAGES Introduction to Programming.
Review: A Structural View program modules -> main program -> functions -> libraries statements -> simple statements -> compound statements expressions.
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
Introduction to python programming
String and Lists Dr. José M. Reyes Álamo.
Intro to CS Nov 21, 2016.
Data types: Complex types (List)
Topics Dictionaries Sets Serializing Objects. Topics Dictionaries Sets Serializing Objects.
When to use Tuples instead of Lists
Containers and Lists CIS 40 – Introduction to Programming in Python
From Think Python How to Think Like a Computer Scientist
LING 388: Computers and Language
Lists Part 1 Taken from notes by Dr. Neil Moore & Dr. Debby Keen
CISC101 Reminders Quiz 2 this week.
Lists Part 1 Taken from notes by Dr. Neil Moore
Bryan Burlingame 03 October 2018
Lists in Python.
Creation, Traversal, Insertion and Removal
CHAPTER THREE Sequences.
Guide to Programming with Python
Lesson 09: Lists Topic: Introduction to Programming, Zybook Ch 8, P4E Ch 8. Slides on website.
6. Lists Let's Learn Python and Pygame
Data Structures – 1D Lists
String and Lists Dr. José M. Reyes Álamo.
Chapter 5: Lists and Dictionaries
Ruth Anderson UW CSE 160 Winter 2017
Python Data Structures: Lists
Lesson 09: Lists Class Chat: Attendance: Participation
Python Tutorial for C Programmer Boontee Kruatrachue Kritawan Siriboon
Lists Part 1 Taken from notes by Dr. Neil Moore
Topics Dictionaries Sets Serializing Objects. Topics Dictionaries Sets Serializing Objects.
Dictionaries Dictionary: object that stores a collection of data
(more) Python.
Python Basics with Jupyter Notebook
CISC101 Reminders Assignment 2 due today.
CHAPTER 4: Lists, Tuples and Dictionaries
Python Data Structures: Lists
Python Data Structures: Lists
Introduction to Programming with Python
And now for something completely different . . .
Python Review
Ruth Anderson UW CSE 160 Spring 2018
CSE 231 Lab 8.
Winter 2019 CISC101 5/26/2019 CISC101 Reminders
For loop Using lists.
Introduction to Dictionaries
Class code for pythonroom.com cchsp2cs
Sample lecture slides.
Dictionary.
Python List.
Introduction to Computer Science
Ruth Anderson UW CSE 160 Winter 2016
Presentation transcript:

Python Open source Many applications Python 3 jupyter notebook Indentation : no begin end

Variable Case sensitive

Type conversion

Python data types float : real numbers int : integer numbers str : string, text bool : True.False Python List : [a, b, c] Collection of variables Contain any type Contain different types

Subset of lists Zero based indexing : [1, “ab”, 3.4] 1은 0번째 “ab"는 1번째

List slicing : 를 이용함2 list[index1: index2 ] list[:index] list[index:] : 를 이용함2 list[index1: index2 ] index1 부터 index2-1 까지 test[2:4] : text list의 2번째 부터 (4-1) 번째 list[:index] list[index:] -3 -2 -1 1 2 3 4 5

List indexing List of lists

Mutable List Mutable : 내용을 변화할 수 있음 Change list elements Add list elements Remove list elements

Adding and removing

Replace list elements

Copying lists Use = sign to copy lists

Copying lists x y Use list to copy

Looping through a list indentation for item-variable in list : # code

While loop while condition : # code

Sorting a list and append an element sorted() sort()

ranges range(index) : 0 – (index-1)

Dictionary Key와 value로 표현되는 데이터 구조 Mutable Create an empty dictionary Create a dictionary

Delete a dictionary elements List와 마찬가지로 del del(list[index]) del(dictionary[key])

Unique keys

Returning a value and get() function

Print dictionary elements

Print dictionary items dictionary.items() 은 key value pair return

Dictionary contains a dictionary

Print dictionary items

Remove items